Skip to contentSkip to conversation

Secure user authentication using RPCSEC_GSS [1/7]

PATCH New Trond Myklebust 1 participant 1 message Oct 31, 2002

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Secure user authentication using RPCSEC_GSS [1/7]

Clean up RPC auth credential cache.

- Convert creds to use list_head rather than singly linked list for efficiency.

- Fix race in rpcauth_lookup_credcache(). Ensure that we only create one entry per user.

- Clean out unused routines rpcauth_remove_credcache() and rpcauth_insert_credcache().

- Perform garbage collection automatically while traversing the hashchain.

- Clean out unused exported symbols.

Cheers,
Trond

include/linux/sunrpc/auth.h +2 -6
diff -u --recursive --new-file linux-2.5.44-00-fixes/include/linux/sunrpc/auth.h linux-2.5.44-01-auth/include/linux/sunrpc/auth.h
@@ -23,7 +23,7 @@
  * Client user credentials
  */
 struct rpc_cred {
-	struct rpc_cred *	cr_next;	/* linked list */
+	struct list_head	cr_hash;	/* hash chain */
 	struct rpc_auth *	cr_auth;
 	struct rpc_credops *	cr_ops;
 	unsigned long		cr_expire;	/* when to gc */
@@ -49,7 +49,7 @@
 #define RPC_CREDCACHE_NR	8
 #define RPC_CREDCACHE_MASK	(RPC_CREDCACHE_NR - 1)
 struct rpc_auth {
-	struct rpc_cred *	au_credcache[RPC_CREDCACHE_NR];
+	struct list_head	au_credcache[RPC_CREDCACHE_NR];
 	unsigned long		au_expire;	/* cache expiry interval */
 	unsigned long		au_nextgc;	/* next garbage collection */
 	unsigned int		au_cslack;	/* call cred size estimate */
@@ -101,8 +101,6 @@
 void			rpcauth_holdcred(struct rpc_task *);
 void			put_rpccred(struct rpc_cred *);
 void			rpcauth_unbindcred(struct rpc_task *);
-int			rpcauth_matchcred(struct rpc_auth *,
-					  struct rpc_cred *, int);
 u32 *			rpcauth_marshcred(struct rpc_task *, u32 *);
 u32 *			rpcauth_checkverf(struct rpc_task *, u32 *);
 int			rpcauth_refreshcred(struct rpc_task *);
@@ -110,8 +108,6 @@
 int			rpcauth_uptodatecred(struct rpc_task *);
 void			rpcauth_init_credcache(struct rpc_auth *);
 void			rpcauth_free_credcache(struct rpc_auth *);
-void			rpcauth_insert_credcache(struct rpc_auth *,
-						struct rpc_cred *);
 
 static inline
 struct rpc_cred *	get_rpccred(struct rpc_cred *cred)
net/sunrpc/auth.c +76 -102

267 lines not on this page · raw message

net/sunrpc/sunrpc_syms.c +0 -5
diff -u --recursive --new-file linux-2.5.44-00-fixes/net/sunrpc/sunrpc_syms.c linux-2.5.44-01-auth/net/sunrpc/sunrpc_syms.c
@@ -62,12 +62,7 @@
 /* Client credential cache */
 EXPORT_SYMBOL(rpcauth_register);
 EXPORT_SYMBOL(rpcauth_unregister);
-EXPORT_SYMBOL(rpcauth_init_credcache);
-EXPORT_SYMBOL(rpcauth_free_credcache);
-EXPORT_SYMBOL(rpcauth_insert_credcache);
 EXPORT_SYMBOL(rpcauth_lookupcred);
-EXPORT_SYMBOL(rpcauth_bindcred);
-EXPORT_SYMBOL(rpcauth_matchcred);
 EXPORT_SYMBOL(put_rpccred);
 
 /* RPC server stuff */

-------------------------------------------------------
This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs