Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357809
b: refs/heads/master
c: 683428f
h: refs/heads/master
i:
  357807: e851bce
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent fef84f6 commit cb1ea57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: 90602c7b192fdd3e6b7c7623479f4bc86ed7ee34
refs/heads/master: 683428fae8c73d7d7da0fa2e0b6beb4d8df4e808
18 changes: 13 additions & 5 deletions trunk/net/sunrpc/auth_gss/svcauth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ static int rsc_parse(struct cache_detail *cd,
{
/* contexthandle expiry [ uid gid N <n gids> mechname ...mechdata... ] */
char *buf = mesg;
int id;
int len, rv;
struct rsc rsci, *rscp = NULL;
time_t expiry;
Expand All @@ -444,16 +445,24 @@ static int rsc_parse(struct cache_detail *cd,
goto out;

/* uid, or NEGATIVE */
rv = get_int(&mesg, &rsci.cred.cr_uid);
rv = get_int(&mesg, &id);
if (rv == -EINVAL)
goto out;
if (rv == -ENOENT)
set_bit(CACHE_NEGATIVE, &rsci.h.flags);
else {
int N, i;

/* uid */
rsci.cred.cr_uid = make_kuid(&init_user_ns, id);
if (!uid_valid(rsci.cred.cr_uid))
goto out;

/* gid */
if (get_int(&mesg, &rsci.cred.cr_gid))
if (get_int(&mesg, &id))
goto out;
rsci.cred.cr_gid = make_kgid(&init_user_ns, id);
if (!gid_valid(rsci.cred.cr_gid))
goto out;

/* number of additional gid's */
Expand All @@ -467,11 +476,10 @@ static int rsc_parse(struct cache_detail *cd,
/* gid's */
status = -EINVAL;
for (i=0; i<N; i++) {
gid_t gid;
kgid_t kgid;
if (get_int(&mesg, &gid))
if (get_int(&mesg, &id))
goto out;
kgid = make_kgid(&init_user_ns, gid);
kgid = make_kgid(&init_user_ns, id);
if (!gid_valid(kgid))
goto out;
GROUP_AT(rsci.cred.cr_group_info, i) = kgid;
Expand Down

0 comments on commit cb1ea57

Please sign in to comment.