patch-2.2.18 linux/net/sunrpc/auth_null.c

Next file: linux/net/sunrpc/auth_unix.c
Previous file: linux/net/sunrpc/auth.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/net/sunrpc/auth_null.c linux/net/sunrpc/auth_null.c
@@ -38,6 +38,7 @@
 nul_destroy(struct rpc_auth *auth)
 {
 	dprintk("RPC: destroying NULL authenticator %p\n", auth);
+	rpcauth_free_credcache(auth);
 	rpc_free(auth);
 }
 
@@ -45,17 +46,15 @@
  * Create NULL creds for current process
  */
 static struct rpc_cred *
-nul_create_cred(struct rpc_task *task)
+nul_create_cred(int flags)
 {
 	struct rpc_cred	*cred;
 
-	if (!(cred = (struct rpc_cred *) rpc_malloc(task, sizeof(*cred)))) {
-		task->tk_status = -ENOMEM;
+	if (!(cred = (struct rpc_cred *) rpc_allocate(flags, sizeof(*cred))))
 		return NULL;
-	}
-
 	cred->cr_count = 0;
 	cred->cr_flags = RPCAUTH_CRED_UPTODATE;
+	cred->cr_uid = current->uid;
 
 	return cred;
 }
@@ -73,7 +72,7 @@
  * Match cred handle against current process
  */
 static int
-nul_match(struct rpc_task *task, struct rpc_cred *cred)
+nul_match(struct rpc_cred *cred, int taskflags)
 {
 	return 1;
 }
@@ -110,10 +109,12 @@
 		printk("RPC: bad verf flavor: %ld\n", (unsigned long) n);
 		return NULL;
 	}
-	if ((n = ntohl(*p++)) != 0) {
+	if ((n = ntohl(*p++)) > 400) {
 		printk("RPC: bad verf size: %ld\n", (unsigned long) n);
 		return NULL;
 	}
+	if (n)
+		p += XDR_QUADLEN(n);
 
 	return p;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)