Messages in this thread Patch in this message | | | Subject | [PATCH] Re: A new lockd patch | Date | Sun, 28 Feb 1999 16:34:55 -0800 | From | "G. Allen Morris III" <> |
| |
Here is a patch to solve the lockd access problem.
This has been tested with Linux and SunOS 5.
On the client side h_authflavor should be set by the data in the nfs superblock: (just like nfs.)
host->h_authflavor = RPC_AUTH_UNIX;
I am not sure what should happen on the server side.
Allen
----------------- diff -u -X exclude linux-2.2.1/fs/lockd/svcsubs.c linux/fs/lockd/svcsubs.c --- linux-2.2.1/fs/lockd/svcsubs.c Fri Jan 1 23:03:08 1999 +++ linux/fs/lockd/svcsubs.c Sun Feb 28 16:09:48 1999 @@ -52,8 +52,6 @@ struct nlm_file *file; unsigned int hash; u32 nfserr; - uid_t saved_cr_uid; - struct svc_cred *cred; dprintk("lockd: nlm_file_lookup(%s/%u)\n", kdevname(u32_to_kdev_t(fh->fh_dev)), fh->fh_ino); @@ -86,15 +84,10 @@ * We have to make sure we have the right credential to open * the file. */ - cred = &rqstp->rq_cred; - saved_cr_uid = cred->cr_uid; - cred->cr_uid = 0; if ((nfserr = nlmsvc_ops->fopen(rqstp, fh, &file->f_file)) != 0) { dprintk("lockd: open failed (nfserr %ld)\n", ntohl(nfserr)); - cred->cr_uid = saved_cr_uid; goto out_free; } - cred->cr_uid = saved_cr_uid; file->f_next = nlm_files[hash]; nlm_files[hash] = file; --- linux-2.2.1/fs/lockd/host.c Fri Jan 1 23:03:08 1999 +++ linux/fs/lockd/host.c Sun Feb 28 13:33:00 1999 @@ -134,7 +134,7 @@ host->h_addr.sin_port = 0; /* ouch! */ host->h_version = version; host->h_proto = proto; - host->h_authflavor = RPC_AUTH_NULL; + host->h_authflavor = RPC_AUTH_UNIX; host->h_rpcclnt = NULL; host->h_sema = MUTEX; host->h_nextrebind = jiffies + NLM_HOST_REBIND; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |