Skip to contentSkip to conversation

Make locks work on NFS3 krb5 mounts

PATCH New Mark Goodman 1 participant 1 message Sep 23, 2004

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

PATCH 1/1 Make locks work on NFS3 krb5 mounts

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.

net/sunrpc/clnt.c 2004-09-23 13:35:12.028606648 -0700 renamed from net/sunrpc/clnt.c.orig 2004-09-12 22:32:17.000000000 -0700 +0 -0
@@ -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);