Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372219
b: refs/heads/master
c: 676e4eb
h: refs/heads/master
i:
  372217: cf7cfe0
  372215: 8319a06
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Apr 30, 2013
1 parent 2e0c516 commit b8f09ea
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 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: ed9411a00464860cafe7e07224818cdf04fd9e89
refs/heads/master: 676e4ebd5f2c3b4fd1d2bff79b68385c23c5c105
26 changes: 20 additions & 6 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3085,10 +3085,11 @@ static __be32
nfsd4_do_encode_secinfo(struct nfsd4_compoundres *resp,
__be32 nfserr, struct svc_export *exp)
{
u32 i, nflavs;
u32 i, nflavs, supported;
struct exp_flavor_info *flavs;
struct exp_flavor_info def_flavs[2];
__be32 *p;
__be32 *p, *flavorsp;
static bool report = true;

if (nfserr)
goto out;
Expand All @@ -3112,27 +3113,40 @@ nfsd4_do_encode_secinfo(struct nfsd4_compoundres *resp,
}
}

supported = 0;
RESERVE_SPACE(4);
WRITE32(nflavs);
flavorsp = p++; /* to be backfilled later */
ADJUST_ARGS();

for (i = 0; i < nflavs; i++) {
rpc_authflavor_t pf = flavs[i].pseudoflavor;
struct rpcsec_gss_info info;

if (rpcauth_get_gssinfo(flavs[i].pseudoflavor, &info) == 0) {
if (rpcauth_get_gssinfo(pf, &info) == 0) {
supported++;
RESERVE_SPACE(4 + 4 + info.oid.len + 4 + 4);
WRITE32(RPC_AUTH_GSS);
WRITE32(info.oid.len);
WRITEMEM(info.oid.data, info.oid.len);
WRITE32(info.qop);
WRITE32(info.service);
ADJUST_ARGS();
} else {
} else if (pf < RPC_AUTH_MAXFLAVOR) {
supported++;
RESERVE_SPACE(4);
WRITE32(flavs[i].pseudoflavor);
WRITE32(pf);
ADJUST_ARGS();
} else {
if (report)
pr_warn("NFS: SECINFO: security flavor %u "
"is not supported\n", pf);
}
}

if (nflavs != supported)
report = false;
*flavorsp = htonl(supported);

out:
if (exp)
exp_put(exp);
Expand Down

0 comments on commit b8f09ea

Please sign in to comment.