summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/nfs/nfs_common.h10
-rw-r--r--sys/nfs/nfs_vnops.c38
-rw-r--r--sys/nfs/nfsm_subs.h10
-rw-r--r--sys/nfs/nfsproto.h8
-rw-r--r--sys/nfsclient/nfs_vnops.c38
-rw-r--r--sys/nfsclient/nfsm_subs.h10
-rw-r--r--sys/nfsserver/nfsm_subs.h10
-rw-r--r--sys/nfsserver/nfsproto.h8
8 files changed, 60 insertions, 72 deletions
diff --git a/sys/nfs/nfs_common.h b/sys/nfs/nfs_common.h
index efba82b..bb254a2 100644
--- a/sys/nfs/nfs_common.h
+++ b/sys/nfs/nfs_common.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
+ * $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
*/
@@ -235,13 +235,11 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(f) = ttattrf; \
} }
-#define nfsm_v3sattr(s, a, u, g) \
+#define nfsm_v3sattr(s, a) \
{ (s)->sa_modetrue = nfs_true; \
(s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
- (s)->sa_uidtrue = nfs_true; \
- (s)->sa_uid = txdr_unsigned(u); \
- (s)->sa_gidtrue = nfs_true; \
- (s)->sa_gid = txdr_unsigned(g); \
+ (s)->sa_uidfalse = nfs_false; \
+ (s)->sa_gidfalse = nfs_false; \
(s)->sa_sizefalse = nfs_false; \
(s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 52896ca..60f516a 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.97 1998/05/31 18:28:45 peter Exp $
+ * $Id: nfs_vnops.c,v 1.98 1998/05/31 18:30:42 peter Exp $
*/
@@ -238,6 +238,7 @@ static int nfs_renameit __P((struct vnode *sdvp,
* Global variables
*/
extern u_long nfs_true, nfs_false;
+extern u_long nfs_xdrneg1;
extern struct nfsstats nfsstats;
extern nfstype nfsv3_type[9];
struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
@@ -727,15 +728,15 @@ nfs_setattrrpc(vp, vap, cred, procp)
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
if (vap->va_mode == (u_short)VNOVAL)
- sp->sa_mode = VNOVAL;
+ sp->sa_mode = nfs_xdrneg1;
else
sp->sa_mode = vtonfsv2_mode(vp->v_type, vap->va_mode);
if (vap->va_uid == (uid_t)VNOVAL)
- sp->sa_uid = VNOVAL;
+ sp->sa_uid = nfs_xdrneg1;
else
sp->sa_uid = txdr_unsigned(vap->va_uid);
if (vap->va_gid == (gid_t)VNOVAL)
- sp->sa_gid = VNOVAL;
+ sp->sa_gid = nfs_xdrneg1;
else
sp->sa_gid = txdr_unsigned(vap->va_gid);
sp->sa_size = txdr_unsigned(vap->va_size);
@@ -1235,7 +1236,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
*tl++ = vtonfsv3_type(vap->va_type);
sp3 = (struct nfsv3_sattr *)tl;
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid, vattr.va_gid);
+ nfsm_v3sattr(sp3, vap);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(major(vap->va_rdev));
@@ -1244,8 +1245,8 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(vattr.va_gid);
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
sp->sa_size = rdev;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
@@ -1368,13 +1369,13 @@ again:
*tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
nfsm_build(tl, u_long *, NFSX_V3SRVSATTR);
sp3 = (struct nfsv3_sattr *)tl;
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid, vattr.va_gid);
+ nfsm_v3sattr(sp3, vap);
}
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(vattr.va_gid);
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
sp->sa_size = 0;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
@@ -1757,16 +1758,15 @@ nfs_symlink(ap)
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid,
- cnp->cn_cred->cr_gid);
+ nfsm_v3sattr(sp3, vap);
}
nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN);
if (!v3) {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VLNK, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(cnp->cn_cred->cr_gid);
- sp->sa_size = -1;
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
+ sp->sa_size = nfs_xdrneg1;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
@@ -1833,13 +1833,13 @@ nfs_mkdir(ap)
nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid, vattr.va_gid);
+ nfsm_v3sattr(sp3, vap);
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(vattr.va_gid);
- sp->sa_size = -1;
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
+ sp->sa_size = nfs_xdrneg1;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index efba82b..bb254a2 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
+ * $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
*/
@@ -235,13 +235,11 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(f) = ttattrf; \
} }
-#define nfsm_v3sattr(s, a, u, g) \
+#define nfsm_v3sattr(s, a) \
{ (s)->sa_modetrue = nfs_true; \
(s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
- (s)->sa_uidtrue = nfs_true; \
- (s)->sa_uid = txdr_unsigned(u); \
- (s)->sa_gidtrue = nfs_true; \
- (s)->sa_gid = txdr_unsigned(g); \
+ (s)->sa_uidfalse = nfs_false; \
+ (s)->sa_gidfalse = nfs_false; \
(s)->sa_sizefalse = nfs_false; \
(s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
diff --git a/sys/nfs/nfsproto.h b/sys/nfs/nfsproto.h
index ada9926..9ada127 100644
--- a/sys/nfs/nfsproto.h
+++ b/sys/nfs/nfsproto.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsproto.h,v 1.3 1997/02/22 09:42:50 peter Exp $
+ * $Id: nfsproto.h,v 1.4 1998/05/31 17:27:58 peter Exp $
*/
#ifndef _NFS_NFSPROTO_H_
@@ -371,10 +371,8 @@ struct nfsv2_sattr {
struct nfsv3_sattr {
u_long sa_modetrue;
u_long sa_mode;
- u_long sa_uidtrue;
- u_long sa_uid;
- u_long sa_gidtrue;
- u_long sa_gid;
+ u_long sa_uidfalse;
+ u_long sa_gidfalse;
u_long sa_sizefalse;
u_long sa_atimetype;
nfstime3 sa_atime;
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 52896ca..60f516a 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.97 1998/05/31 18:28:45 peter Exp $
+ * $Id: nfs_vnops.c,v 1.98 1998/05/31 18:30:42 peter Exp $
*/
@@ -238,6 +238,7 @@ static int nfs_renameit __P((struct vnode *sdvp,
* Global variables
*/
extern u_long nfs_true, nfs_false;
+extern u_long nfs_xdrneg1;
extern struct nfsstats nfsstats;
extern nfstype nfsv3_type[9];
struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
@@ -727,15 +728,15 @@ nfs_setattrrpc(vp, vap, cred, procp)
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
if (vap->va_mode == (u_short)VNOVAL)
- sp->sa_mode = VNOVAL;
+ sp->sa_mode = nfs_xdrneg1;
else
sp->sa_mode = vtonfsv2_mode(vp->v_type, vap->va_mode);
if (vap->va_uid == (uid_t)VNOVAL)
- sp->sa_uid = VNOVAL;
+ sp->sa_uid = nfs_xdrneg1;
else
sp->sa_uid = txdr_unsigned(vap->va_uid);
if (vap->va_gid == (gid_t)VNOVAL)
- sp->sa_gid = VNOVAL;
+ sp->sa_gid = nfs_xdrneg1;
else
sp->sa_gid = txdr_unsigned(vap->va_gid);
sp->sa_size = txdr_unsigned(vap->va_size);
@@ -1235,7 +1236,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
*tl++ = vtonfsv3_type(vap->va_type);
sp3 = (struct nfsv3_sattr *)tl;
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid, vattr.va_gid);
+ nfsm_v3sattr(sp3, vap);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(major(vap->va_rdev));
@@ -1244,8 +1245,8 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(vattr.va_gid);
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
sp->sa_size = rdev;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
@@ -1368,13 +1369,13 @@ again:
*tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
nfsm_build(tl, u_long *, NFSX_V3SRVSATTR);
sp3 = (struct nfsv3_sattr *)tl;
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid, vattr.va_gid);
+ nfsm_v3sattr(sp3, vap);
}
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(vattr.va_gid);
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
sp->sa_size = 0;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
@@ -1757,16 +1758,15 @@ nfs_symlink(ap)
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid,
- cnp->cn_cred->cr_gid);
+ nfsm_v3sattr(sp3, vap);
}
nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN);
if (!v3) {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VLNK, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(cnp->cn_cred->cr_gid);
- sp->sa_size = -1;
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
+ sp->sa_size = nfs_xdrneg1;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
@@ -1833,13 +1833,13 @@ nfs_mkdir(ap)
nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
- nfsm_v3sattr(sp3, vap, cnp->cn_cred->cr_uid, vattr.va_gid);
+ nfsm_v3sattr(sp3, vap);
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode);
- sp->sa_uid = txdr_unsigned(cnp->cn_cred->cr_uid);
- sp->sa_gid = txdr_unsigned(vattr.va_gid);
- sp->sa_size = -1;
+ sp->sa_uid = nfs_xdrneg1;
+ sp->sa_gid = nfs_xdrneg1;
+ sp->sa_size = nfs_xdrneg1;
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
diff --git a/sys/nfsclient/nfsm_subs.h b/sys/nfsclient/nfsm_subs.h
index efba82b..bb254a2 100644
--- a/sys/nfsclient/nfsm_subs.h
+++ b/sys/nfsclient/nfsm_subs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
+ * $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
*/
@@ -235,13 +235,11 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(f) = ttattrf; \
} }
-#define nfsm_v3sattr(s, a, u, g) \
+#define nfsm_v3sattr(s, a) \
{ (s)->sa_modetrue = nfs_true; \
(s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
- (s)->sa_uidtrue = nfs_true; \
- (s)->sa_uid = txdr_unsigned(u); \
- (s)->sa_gidtrue = nfs_true; \
- (s)->sa_gid = txdr_unsigned(g); \
+ (s)->sa_uidfalse = nfs_false; \
+ (s)->sa_gidfalse = nfs_false; \
(s)->sa_sizefalse = nfs_false; \
(s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
diff --git a/sys/nfsserver/nfsm_subs.h b/sys/nfsserver/nfsm_subs.h
index efba82b..bb254a2 100644
--- a/sys/nfsserver/nfsm_subs.h
+++ b/sys/nfsserver/nfsm_subs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsm_subs.h,v 1.18 1998/05/31 17:48:07 peter Exp $
+ * $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
*/
@@ -235,13 +235,11 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(f) = ttattrf; \
} }
-#define nfsm_v3sattr(s, a, u, g) \
+#define nfsm_v3sattr(s, a) \
{ (s)->sa_modetrue = nfs_true; \
(s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
- (s)->sa_uidtrue = nfs_true; \
- (s)->sa_uid = txdr_unsigned(u); \
- (s)->sa_gidtrue = nfs_true; \
- (s)->sa_gid = txdr_unsigned(g); \
+ (s)->sa_uidfalse = nfs_false; \
+ (s)->sa_gidfalse = nfs_false; \
(s)->sa_sizefalse = nfs_false; \
(s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
diff --git a/sys/nfsserver/nfsproto.h b/sys/nfsserver/nfsproto.h
index ada9926..9ada127 100644
--- a/sys/nfsserver/nfsproto.h
+++ b/sys/nfsserver/nfsproto.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsproto.h,v 1.3 1997/02/22 09:42:50 peter Exp $
+ * $Id: nfsproto.h,v 1.4 1998/05/31 17:27:58 peter Exp $
*/
#ifndef _NFS_NFSPROTO_H_
@@ -371,10 +371,8 @@ struct nfsv2_sattr {
struct nfsv3_sattr {
u_long sa_modetrue;
u_long sa_mode;
- u_long sa_uidtrue;
- u_long sa_uid;
- u_long sa_gidtrue;
- u_long sa_gid;
+ u_long sa_uidfalse;
+ u_long sa_gidfalse;
u_long sa_sizefalse;
u_long sa_atimetype;
nfstime3 sa_atime;
OpenPOWER on IntegriCloud