Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347637
b: refs/heads/master
c: 12fc3e9
h: refs/heads/master
i:
  347635: cf6dead
v: v3
  • Loading branch information
J. Bruce Fields committed Nov 8, 2012
1 parent e1ea27e commit 6247967
Show file tree
Hide file tree
Showing 4 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: 57725155dc1b8c78b7a96886d5cdc69dc89e9c54
refs/heads/master: 12fc3e92d4b18b4e99af624586e1696479ff36ce
3 changes: 1 addition & 2 deletions trunk/fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
args.bc_xprt = conn->cb_xprt;
args.prognumber = clp->cl_cb_session->se_cb_prog;
args.protocol = XPRT_TRANSPORT_BC_TCP;
args.authflavor = RPC_AUTH_UNIX;
args.authflavor = ses->se_cb_sec.flavor;
}
/* Create RPC client */
client = rpc_create(&args);
Expand All @@ -709,7 +709,6 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
clp->cl_cb_client = client;
clp->cl_cb_cred = cred;
return 0;

}

static void warn_no_callback_path(struct nfs4_client *clp, int reason)
Expand Down
14 changes: 11 additions & 3 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,20 +425,23 @@ nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access
static __be32 nfsd4_decode_cb_sec(struct nfsd4_compoundargs *argp, struct nfsd4_cb_sec *cbs)
{
DECODE_HEAD;
u32 dummy;
u32 dummy, uid, gid;
char *machine_name;
int i;
int nr_secflavs;

/* callback_sec_params4 */
READ_BUF(4);
READ32(nr_secflavs);
cbs->flavor = (u32)(-1);
for (i = 0; i < nr_secflavs; ++i) {
READ_BUF(4);
READ32(dummy);
switch (dummy) {
case RPC_AUTH_NULL:
/* Nothing to read */
if (cbs->flavor == (u32)(-1))
cbs->flavor = RPC_AUTH_NULL;
break;
case RPC_AUTH_UNIX:
READ_BUF(8);
Expand All @@ -452,13 +455,18 @@ static __be32 nfsd4_decode_cb_sec(struct nfsd4_compoundargs *argp, struct nfsd4_

/* uid, gid */
READ_BUF(8);
READ32(cbs->uid);
READ32(cbs->gid);
READ32(uid);
READ32(gid);

/* more gids */
READ_BUF(4);
READ32(dummy);
READ_BUF(dummy * 4);
if (cbs->flavor == (u32)(-1)) {
cbs->uid = uid;
cbs->gid = gid;
cbs->flavor = RPC_AUTH_UNIX;
}
break;
case RPC_AUTH_GSS:
dprintk("RPC_AUTH_GSS callback secflavor "
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct nfsd4_channel_attrs {
};

struct nfsd4_cb_sec {
u32 flavor; /* (u32)(-1) used to mean "no valid flavor" */
u32 uid;
u32 gid;
};
Expand Down

0 comments on commit 6247967

Please sign in to comment.