Messages in this thread Patches in this message | | | Date | Fri, 24 Sep 1999 10:11:48 -0700 | From | "H . J . Lu" <> | Subject | Re: knfsd 1.5 is released |
| |
On Fri, Sep 24, 1999 at 11:31:16AM +1000, Neil Brown wrote: > > ---- > > David's Patches were only a work-in-progress, not really ready for > serious use yet. The usage of "d_path" in nfsd_netlink_notify is all > wrong for a start. > I have mailed David privately about this and he plans to tidy it up > soonish, but until then, I don't think the mountd changes in 1.5 > should be used, so I won't be making a patch against them. >
I am appending 2 patches to address some of the problems in knfsd 1.5. Please check them out.
Thanks.
H.J. diff -upr -x CVS -x *.o -x .* linux.mountd/fs/nfsd/netlink.c linux/fs/nfsd/netlink.c --- linux.mountd/fs/nfsd/netlink.c Fri Sep 24 10:52:52 1999 +++ linux/fs/nfsd/netlink.c Fri Sep 24 10:37:27 1999 @@ -56,6 +56,7 @@ int nfsd_netlink_notify(struct svc_rqst struct sk_buff *outskb; struct nfsd_netlink_callback *cbk; struct vfsmount *vfsm; + char *path; if (nfsdnlsk == NULL) return nfserr_stale; @@ -91,7 +92,12 @@ int nfsd_netlink_notify(struct svc_rqst strncpy(cbk->path, vfsm->mnt_dirname, NFS_MAXPATHLEN); cbk->devlen = strlen(vfsm->mnt_dirname); - d_path(d, &cbk->path[cbk->devlen+1], NFS_MAXPATHLEN - cbk->devlen); + if (NFS_MAXPATHLEN - cbk->devlen > 1) { + path = d_path(d, &cbk->path[cbk->devlen+1], + NFS_MAXPATHLEN - cbk->devlen); + memmove (&cbk->path[cbk->devlen+1], path, + &cbk->path[NFS_MAXPATHLEN] - path + 1); + } netlink_broadcast(nfsdnlsk, outskb, 0, ~0, GFP_KERNEL); Only in linux/fs/nfsd: nfsfh.c.orig diff -upr -x CVS -x *.o -x .* linux.mountd/fs/nfsd/nfssvc.c linux/fs/nfsd/nfssvc.c --- linux.mountd/fs/nfsd/nfssvc.c Fri Sep 24 10:52:52 1999 +++ linux/fs/nfsd/nfssvc.c Fri Sep 24 09:32:28 1999 @@ -116,8 +116,6 @@ nfsd(struct svc_rqst *rqstp) exit_mm(current); current->session = 1; current->pgrp = 1; - /* Let svc_process check client's authentication. */ - rqstp->rq_auth = 1; sprintf(current->comm, "nfsd"); oldumask = current->fs->umask; /* Set umask to 0. */ Only in linux/include: asm Only in linux/include: config Only in linux/include/linux: autoconf.h Only in linux/include/linux: compile.h Only in linux/include/linux: modules Only in linux/include/linux: modversions.h diff -upr -x CVS -x *.o -x .* linux.mountd/include/linux/sunrpc/svc.h linux/include/linux/sunrpc/svc.h --- linux.mountd/include/linux/sunrpc/svc.h Thu Jun 10 21:05:02 1999 +++ linux/include/linux/sunrpc/svc.h Fri Sep 24 09:32:56 1999 @@ -107,8 +107,7 @@ struct svc_rqst { u32 rq_prot; /* IP protocol */ unsigned short rq_verfed : 1, /* reply has verifier */ rq_userset : 1, /* auth->setuser OK */ - rq_secure : 1, /* secure port */ - rq_auth : 1; /* check client */ + rq_secure : 1; /* secure port */ void * rq_argp; /* decoded arguments */ void * rq_resp; /* xdr'd results */ Only in linux/include/linux: version.h Only in linux/lib: lib.a Only in linux: makefile Only in linux: modules Only in linux/net: network.a diff -upr -x CVS -x *.o -x .* linux.mountd/net/sunrpc/svc.c linux/net/sunrpc/svc.c --- linux.mountd/net/sunrpc/svc.c Fri Sep 24 10:52:52 1999 +++ linux/net/sunrpc/svc.c Fri Sep 24 09:32:42 1999 @@ -244,13 +244,6 @@ svc_process(struct svc_serv *serv, struc argp->buf += 5; argp->len -= 5; - /* Used by nfsd to only allow the NULL procedure for amd. */ -#if 0 - if (rqstp->rq_auth && !rqstp->rq_client && proc) { - auth_stat = rpc_autherr_badcred; - goto err_bad_auth; - } -#endif /* * Decode auth data, and add verifier to reply buffer. * We do this before anything else in order to get a decentIndex: utils/mountd/mountd.c =================================================================== RCS file: /home/cvsroot/knfsd/utils/mountd/mountd.c,v retrieving revision 1.17 diff -u -p -r1.17 mountd.c --- mountd.c 1999/09/23 23:20:14 1.17 +++ mountd.c 1999/09/24 17:06:06 @@ -78,7 +78,7 @@ void nlfd_handler(int fd) return; } - nclp = xmalloc(sizeof(*nclp)); + nclp = alloca (sizeof(*nclp)); memset(nclp, 0, sizeof(*nclp)); strncpy(nclp->cl_ident, hp->h_name, NFSCLNT_IDMAX); @@ -90,8 +90,6 @@ void nlfd_handler(int fd) inet_ntoa(buf.s.sin_addr), sys_errlist[errno]); } - xfree(nclp); - nexp = xmalloc(sizeof(*nexp)); strncpy(nexp->ex_client, hp->h_name, NFSCLNT_IDMAX); strncpy(nexp->ex_path, buf.path, NFS_MAXPATHLEN); @@ -101,8 +99,8 @@ void nlfd_handler(int fd) if (nfsexport(nexp)) { - buf.path[buf.devlen] = '/'; - xlog(L_ERROR, "addexport for refused %s:%s failed: %s", + buf.path[buf.devlen] = ':'; + xlog(L_ERROR, "addexport for refused %s:%s failed", hp->h_name, buf.path); return; } @@ -131,7 +129,6 @@ static struct option longopts[] = }; static int nfs_version = -1; -extern int auth_need_reload; /* * Signal handler. @@ -139,11 +136,6 @@ extern int auth_need_reload; static void killer (int sig) { - if (sig == SIGHUP) { - xlog(L_NOTICE, "Received SIGHUP, reloading export table."); - auth_need_reload = 1; - return; - } if (nfs_version & 0x1) pmap_unset (MOUNTPROG, MOUNTVERS); if (nfs_version & (0x1 << 1)) | |