[PATCH] Make locks work on NFS3 krb5 mounts

From: Mark Goodman
Date: Thu Sep 23 2004 - 18:49:15 EST


This patch makes locks work on NFS3 krb5 mounts. In particular, it makes gconf-sanity-check-1 succeed when my home directory is a NFS3 krb5 mount. gconf-sanity-check-1 is part of GConf. It applies to 2.6.9-rc2. Please consider applying.

Signed-off-by: Mark Goodman <mgoodman@xxxxxxxxxxxxxxxxx>

--- linux-2.6.9-rc2/net/sunrpc/clnt.c.orig 2004-09-12 22:32:17.000000000 -0700
+++ linux-2.6.9-rc2/net/sunrpc/clnt.c 2004-09-23 13:35:12.028606648 -0700
@@ -425,6 +425,16 @@ rpc_call_setup(struct rpc_task *task, st
{
task->tk_msg = *msg;
task->tk_flags |= flags;
+
+ /*
+ * For a nfs3 krb5 mount, lockd tries to use a RPCSEC cred with UNIX
+ * auth. If that's the case, get a UNIX cred.
+ */
+ if (task->tk_msg.rpc_cred != NULL &&
+ task->tk_msg.rpc_cred->cr_auth->au_ops != task->tk_auth->au_ops) {
+ task->tk_msg.rpc_cred = NULL;
+ }
+
/* Bind the user cred */
if (task->tk_msg.rpc_cred != NULL) {
rpcauth_holdcred(task);




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/