Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25581
b: refs/heads/master
c: 54cceeb
h: refs/heads/master
i:
  25579: 326566b
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Apr 11, 2006
1 parent 3698ee4 commit 936a6bd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd15654963cf7e4dd938a403de3ec5bcd09f8350
refs/heads/master: 54cceebb679a8d10fa382422aa2035cdc65fe7ce
46 changes: 23 additions & 23 deletions trunk/fs/nfsd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,46 @@

int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
{
struct svc_cred *cred = &rqstp->rq_cred;
struct svc_cred cred = rqstp->rq_cred;
int i;
int ret;

if (exp->ex_flags & NFSEXP_ALLSQUASH) {
cred->cr_uid = exp->ex_anon_uid;
cred->cr_gid = exp->ex_anon_gid;
put_group_info(cred->cr_group_info);
cred->cr_group_info = groups_alloc(0);
cred.cr_uid = exp->ex_anon_uid;
cred.cr_gid = exp->ex_anon_gid;
cred.cr_group_info = groups_alloc(0);
} else if (exp->ex_flags & NFSEXP_ROOTSQUASH) {
struct group_info *gi;
if (!cred->cr_uid)
cred->cr_uid = exp->ex_anon_uid;
if (!cred->cr_gid)
cred->cr_gid = exp->ex_anon_gid;
gi = groups_alloc(cred->cr_group_info->ngroups);
if (!cred.cr_uid)
cred.cr_uid = exp->ex_anon_uid;
if (!cred.cr_gid)
cred.cr_gid = exp->ex_anon_gid;
gi = groups_alloc(cred.cr_group_info->ngroups);
if (gi)
for (i = 0; i < cred->cr_group_info->ngroups; i++) {
if (!GROUP_AT(cred->cr_group_info, i))
for (i = 0; i < cred.cr_group_info->ngroups; i++) {
if (!GROUP_AT(cred.cr_group_info, i))
GROUP_AT(gi, i) = exp->ex_anon_gid;
else
GROUP_AT(gi, i) = GROUP_AT(cred->cr_group_info, i);
GROUP_AT(gi, i) = GROUP_AT(cred.cr_group_info, i);
}
put_group_info(cred->cr_group_info);
cred->cr_group_info = gi;
}
cred.cr_group_info = gi;
} else
get_group_info(cred.cr_group_info);

if (cred->cr_uid != (uid_t) -1)
current->fsuid = cred->cr_uid;
if (cred.cr_uid != (uid_t) -1)
current->fsuid = cred.cr_uid;
else
current->fsuid = exp->ex_anon_uid;
if (cred->cr_gid != (gid_t) -1)
current->fsgid = cred->cr_gid;
if (cred.cr_gid != (gid_t) -1)
current->fsgid = cred.cr_gid;
else
current->fsgid = exp->ex_anon_gid;

if (!cred->cr_group_info)
if (!cred.cr_group_info)
return -ENOMEM;
ret = set_current_groups(cred->cr_group_info);
if ((cred->cr_uid)) {
ret = set_current_groups(cred.cr_group_info);
put_group_info(cred.cr_group_info);
if ((cred.cr_uid)) {
cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
} else {
cap_t(current->cap_effective) |= (CAP_NFSD_MASK &
Expand Down

0 comments on commit 936a6bd

Please sign in to comment.