Release 4.10 fs/nfsd/auth.c
/* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> */
#include <linux/sched.h>
#include "nfsd.h"
#include "auth.h"
int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
{
struct exp_flavor_info *f;
struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
for (f = exp->ex_flavors; f < end; f++) {
if (f->pseudoflavor == rqstp->rq_cred.cr_flavor)
return f->flags;
}
return exp->ex_flags;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
j. bruce fields | j. bruce fields | 72 | 100.00% | 2 | 100.00% |
| Total | 72 | 100.00% | 2 | 100.00% |
int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
{
struct group_info *rqgi;
struct group_info *gi;
struct cred *new;
int i;
int flags = nfsexp_flags(rqstp, exp);
validate_process_creds();
/* discard any old override before preparing the new set */
revert_creds(get_cred(current_real_cred()));
new = prepare_creds();
if (!new)
return -ENOMEM;
new->fsuid = rqstp->rq_cred.cr_uid;
new->fsgid = rqstp->rq_cred.cr_gid;
rqgi = rqstp->rq_cred.cr_group_info;
if (flags & NFSEXP_ALLSQUASH) {
new->fsuid = exp->ex_anon_uid;
new->fsgid = exp->ex_anon_gid;
gi = groups_alloc(0);
if (!gi)
goto oom;
} else if (flags & NFSEXP_ROOTSQUASH) {
if (uid_eq(new->fsuid, GLOBAL_ROOT_UID))
new->fsuid = exp->ex_anon_uid;
if (gid_eq(new->fsgid, GLOBAL_ROOT_GID))
new->fsgid = exp->ex_anon_gid;
gi = groups_alloc(rqgi->ngroups);
if (!gi)
goto oom;
for (i = 0; i < rqgi->ngroups; i++) {
if (gid_eq(GLOBAL_ROOT_GID, rqgi->gid[i]))
gi->gid[i] = exp->ex_anon_gid;
else
gi->gid[i] = rqgi->gid[i];
}
} else {
gi = get_group_info(rqgi);
}
if (uid_eq(new->fsuid, INVALID_UID))
new->fsuid = exp->ex_anon_uid;
if (gid_eq(new->fsgid, INVALID_GID))
new->fsgid = exp->ex_anon_gid;
set_groups(new, gi);
put_group_info(gi);
if (!uid_eq(new->fsuid, GLOBAL_ROOT_UID))
new->cap_effective = cap_drop_nfsd_set(new->cap_effective);
else
new->cap_effective = cap_raise_nfsd_set(new->cap_effective,
new->cap_permitted);
validate_process_creds();
put_cred(override_creds(new));
put_cred(new);
validate_process_creds();
return 0;
oom:
abort_creds(new);
return -ENOMEM;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
david howells | david howells | 143 | 36.67% | 5 | 23.81% |
pre-git | pre-git | 119 | 30.51% | 3 | 14.29% |
andrew morton | andrew morton | 34 | 8.72% | 3 | 14.29% |
eric w. biederman | eric w. biederman | 31 | 7.95% | 2 | 9.52% |
j. bruce fields | j. bruce fields | 24 | 6.15% | 3 | 14.29% |
alexey dobriyan | alexey dobriyan | 16 | 4.10% | 1 | 4.76% |
andrew g. morgan | andrew g. morgan | 10 | 2.56% | 1 | 4.76% |
neil brown | neil brown | 9 | 2.31% | 1 | 4.76% |
kinglong mee | kinglong mee | 2 | 0.51% | 1 | 4.76% |
jeff layton | jeff layton | 2 | 0.51% | 1 | 4.76% |
| Total | 390 | 100.00% | 21 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
david howells | david howells | 143 | 30.30% | 5 | 19.23% |
pre-git | pre-git | 124 | 26.27% | 3 | 11.54% |
j. bruce fields | j. bruce fields | 99 | 20.97% | 6 | 23.08% |
andrew morton | andrew morton | 34 | 7.20% | 3 | 11.54% |
eric w. biederman | eric w. biederman | 31 | 6.57% | 2 | 7.69% |
alexey dobriyan | alexey dobriyan | 16 | 3.39% | 1 | 3.85% |
andrew g. morgan | andrew g. morgan | 10 | 2.12% | 1 | 3.85% |
neil brown | neil brown | 9 | 1.91% | 1 | 3.85% |
jeff layton | jeff layton | 2 | 0.42% | 1 | 3.85% |
kinglong mee | kinglong mee | 2 | 0.42% | 1 | 3.85% |
harvey harrison | harvey harrison | 1 | 0.21% | 1 | 3.85% |
boaz harrosh | boaz harrosh | 1 | 0.21% | 1 | 3.85% |
| Total | 472 | 100.00% | 26 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.