Date: Tue, 10 Jun 1997 20:10:01 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs Subject: Re: kern/3838: fifos on nfs-mounted fs no longer permitted Message-ID: <199706110310.UAA24392@hub.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR kern/3838; it has been noted by GNATS.
From: Bruce Evans <bde@zeta.org.au>
To: admin@citylink.dinoex.sub.org, FreeBSD-gnats-submit@freebsd.org
Cc: dfr@freebsd.org
Subject: Re: kern/3838: fifos on nfs-mounted fs no longer permitted
Date: Wed, 11 Jun 1997 12:54:13 +1000
>mkfifo on a nfs-mounted filesystem will reply: "operation not permitted".
>This didn't happen with release 2.1.0. (No, the fs isn't mounted with
>nodev!)
This was broken in the initial v3 import (rev.1.16), which is essentially
the same as Lite2. There are several bugs:
1. In the v2 case, nfsrv_create() lost some special handling for fifos.
suser() is always called, although mkfifo doesn't require special
privileges.
2. In the v3 case, the new nfsrv_mknod() never had enough special handling
for fifos. suser() is always called, except for sockets.
3. In the v3 case, after suser() fails, the error code is eventually
thrown away. nfsrv_mknod() returns 0, and mkfifo() returns the bogus
errno EIO.
Bruce
Untested fixes for (1)-(2):
diff -c2 nfs_serv.c~ nfs_serv.c
*** nfs_serv.c~ Wed Jun 4 11:38:41 1997
--- nfs_serv.c Wed Jun 11 12:43:03 1997
***************
*** 1428,1432 ****
if (vap->va_type == VCHR && rdev == 0xffffffff)
vap->va_type = VFIFO;
! if (error = suser(cred, (u_short *)0)) {
vrele(nd.ni_startdir);
free(nd.ni_cnd.cn_pnbuf, M_NAMEI);
--- 1427,1432 ----
if (vap->va_type == VCHR && rdev == 0xffffffff)
vap->va_type = VFIFO;
! if (vap->va_type == VFIFO &&
! (error = suser(cred, (u_short *)0))) {
vrele(nd.ni_startdir);
free(nd.ni_cnd.cn_pnbuf, M_NAMEI);
***************
*** 1622,1626 ****
FREE(nd.ni_cnd.cn_pnbuf, M_NAMEI);
} else {
! if (error = suser(cred, (u_short *)0)) {
vrele(nd.ni_startdir);
free((caddr_t)nd.ni_cnd.cn_pnbuf, M_NAMEI);
--- 1624,1628 ----
FREE(nd.ni_cnd.cn_pnbuf, M_NAMEI);
} else {
! if (vtyp != VFIFO && (error = suser(cred, (u_short *)0))) {
vrele(nd.ni_startdir);
free((caddr_t)nd.ni_cnd.cn_pnbuf, M_NAMEI);
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706110310.UAA24392>
