aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-30 03:54:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-30 03:54:24 -0500
commit85004cc367abc000aa36c0d0e270ab609a68b0cb (patch)
tree5739aae778d67b6d119fe5c668313fc2823e9836 /net/sunrpc/auth.c
parent149a051f82d2b3860fe32fa182dbc83a66274894 (diff)
parent3fbd67ad61f6d5a09ea717b56c50bc5c3d8042a8 (diff)
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (118 commits) NFSv4: Iterate through all nfs_clients when the server recalls a delegation NFSv4: Deal more correctly with duplicate delegations NFS: Fix a potential race between umount and nfs_access_cache_shrinker() NFS: Add an asynchronous delegreturn operation for use in nfs_clear_inode nfs: convert NFS_*(inode) helpers to static inline nfs: obliterate NFS_FLAGS macro NFS: Address memory leaks in the NFS client mount option parser nfs4: allow nfsv4 acls on non-regular-files NFS: Optimise away the sigmask code in aio/dio reads and writes SUNRPC: Don't bother changing the sigmask for asynchronous RPC calls SUNRPC: rpcb_getport_sync() passes incorrect address size to rpc_create() SUNRPC: Clean up block comment preceding rpcb_getport_sync() SUNRPC: Use appropriate argument types in rpcb client SUNRPC: rpcb_getport_sync() should use built-in hostname generator SUNRPC: Clean up functions that free address_strings array NFS: NFS version number is unsigned NLM: Fix a bogus 'return' in nlmclnt_rpc_release NLM: Introduce an arguments structure for nlmclnt_init() NLM/NFS: Use cached nlm_host when calling nlmclnt_proc() NFS: Invoke nlmclnt_init during NFS mount processing ...
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r--net/sunrpc/auth.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 1ea27559b1de..bcd9abdb031c 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -51,6 +51,7 @@ rpcauth_register(const struct rpc_authops *ops)
51 spin_unlock(&rpc_authflavor_lock); 51 spin_unlock(&rpc_authflavor_lock);
52 return ret; 52 return ret;
53} 53}
54EXPORT_SYMBOL_GPL(rpcauth_register);
54 55
55int 56int
56rpcauth_unregister(const struct rpc_authops *ops) 57rpcauth_unregister(const struct rpc_authops *ops)
@@ -68,6 +69,7 @@ rpcauth_unregister(const struct rpc_authops *ops)
68 spin_unlock(&rpc_authflavor_lock); 69 spin_unlock(&rpc_authflavor_lock);
69 return ret; 70 return ret;
70} 71}
72EXPORT_SYMBOL_GPL(rpcauth_unregister);
71 73
72struct rpc_auth * 74struct rpc_auth *
73rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt) 75rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt)
@@ -102,6 +104,7 @@ rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt)
102out: 104out:
103 return auth; 105 return auth;
104} 106}
107EXPORT_SYMBOL_GPL(rpcauth_create);
105 108
106void 109void
107rpcauth_release(struct rpc_auth *auth) 110rpcauth_release(struct rpc_auth *auth)
@@ -151,6 +154,7 @@ rpcauth_init_credcache(struct rpc_auth *auth)
151 auth->au_credcache = new; 154 auth->au_credcache = new;
152 return 0; 155 return 0;
153} 156}
157EXPORT_SYMBOL_GPL(rpcauth_init_credcache);
154 158
155/* 159/*
156 * Destroy a list of credentials 160 * Destroy a list of credentials
@@ -213,6 +217,7 @@ rpcauth_destroy_credcache(struct rpc_auth *auth)
213 kfree(cache); 217 kfree(cache);
214 } 218 }
215} 219}
220EXPORT_SYMBOL_GPL(rpcauth_destroy_credcache);
216 221
217/* 222/*
218 * Remove stale credentials. Avoid sleeping inside the loop. 223 * Remove stale credentials. Avoid sleeping inside the loop.
@@ -332,6 +337,7 @@ found:
332out: 337out:
333 return cred; 338 return cred;
334} 339}
340EXPORT_SYMBOL_GPL(rpcauth_lookup_credcache);
335 341
336struct rpc_cred * 342struct rpc_cred *
337rpcauth_lookupcred(struct rpc_auth *auth, int flags) 343rpcauth_lookupcred(struct rpc_auth *auth, int flags)
@@ -350,6 +356,7 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags)
350 put_group_info(acred.group_info); 356 put_group_info(acred.group_info);
351 return ret; 357 return ret;
352} 358}
359EXPORT_SYMBOL_GPL(rpcauth_lookupcred);
353 360
354void 361void
355rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred, 362rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
@@ -366,7 +373,7 @@ rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
366#endif 373#endif
367 cred->cr_uid = acred->uid; 374 cred->cr_uid = acred->uid;
368} 375}
369EXPORT_SYMBOL(rpcauth_init_cred); 376EXPORT_SYMBOL_GPL(rpcauth_init_cred);
370 377
371struct rpc_cred * 378struct rpc_cred *
372rpcauth_bindcred(struct rpc_task *task) 379rpcauth_bindcred(struct rpc_task *task)
@@ -378,6 +385,7 @@ rpcauth_bindcred(struct rpc_task *task)
378 .group_info = current->group_info, 385 .group_info = current->group_info,
379 }; 386 };
380 struct rpc_cred *ret; 387 struct rpc_cred *ret;
388 sigset_t oldset;
381 int flags = 0; 389 int flags = 0;
382 390
383 dprintk("RPC: %5u looking up %s cred\n", 391 dprintk("RPC: %5u looking up %s cred\n",
@@ -385,7 +393,9 @@ rpcauth_bindcred(struct rpc_task *task)
385 get_group_info(acred.group_info); 393 get_group_info(acred.group_info);
386 if (task->tk_flags & RPC_TASK_ROOTCREDS) 394 if (task->tk_flags & RPC_TASK_ROOTCREDS)
387 flags |= RPCAUTH_LOOKUP_ROOTCREDS; 395 flags |= RPCAUTH_LOOKUP_ROOTCREDS;
396 rpc_clnt_sigmask(task->tk_client, &oldset);
388 ret = auth->au_ops->lookup_cred(auth, &acred, flags); 397 ret = auth->au_ops->lookup_cred(auth, &acred, flags);
398 rpc_clnt_sigunmask(task->tk_client, &oldset);
389 if (!IS_ERR(ret)) 399 if (!IS_ERR(ret))
390 task->tk_msg.rpc_cred = ret; 400 task->tk_msg.rpc_cred = ret;
391 else 401 else
@@ -435,6 +445,7 @@ need_lock:
435out_destroy: 445out_destroy:
436 cred->cr_ops->crdestroy(cred); 446 cred->cr_ops->crdestroy(cred);
437} 447}
448EXPORT_SYMBOL_GPL(put_rpccred);
438 449
439void 450void
440rpcauth_unbindcred(struct rpc_task *task) 451rpcauth_unbindcred(struct rpc_task *task)