Page MenuHomeFreeBSD

D31952.diff
No OneTemporary

D31952.diff

diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -82,6 +82,15 @@
SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, v4openaccess, CTLFLAG_RW,
&nfsrv_openaccess, 0,
"Enable Linux style NFSv4 Open access check");
+static char nfsrv_scope[NFSV4_OPAQUELIMIT];
+SYSCTL_STRING(_vfs_nfsd, OID_AUTO, scope, CTLFLAG_RWTUN,
+ &nfsrv_scope, NFSV4_OPAQUELIMIT, "Server scope");
+static char nfsrv_owner_major[NFSV4_OPAQUELIMIT];
+SYSCTL_STRING(_vfs_nfsd, OID_AUTO, owner_major, CTLFLAG_RWTUN,
+ &nfsrv_owner_major, NFSV4_OPAQUELIMIT, "Server owner major");
+static uint64_t nfsrv_owner_minor;
+SYSCTL_U64(_vfs_nfsd, OID_AUTO, owner_minor, CTLFLAG_RWTUN,
+ &nfsrv_owner_minor, 0, "Server owner minor");
/*
* This list defines the GSS mechanisms supported.
@@ -4253,7 +4262,6 @@
nfsquad_t clientid, confirm;
uint8_t *verf;
uint32_t sp4type, v41flags;
- uint64_t owner_minor;
struct timespec verstime;
#ifdef INET
struct sockaddr_in *sin, *rin;
@@ -4262,6 +4270,7 @@
struct sockaddr_in6 *sin6, *rin6;
#endif
struct thread *p = curthread;
+ char *s;
if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0)
goto nfsmout;
@@ -4376,12 +4385,17 @@
*tl++ = txdr_unsigned(confirm.lval[0]); /* SequenceID */
*tl++ = txdr_unsigned(v41flags); /* Exch flags */
*tl++ = txdr_unsigned(NFSV4EXCH_SP4NONE); /* No SSV */
- owner_minor = 0; /* Owner */
- txdr_hyper(owner_minor, tl); /* Minor */
- (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid,
- strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Major */
- (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid,
- strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Scope */
+ txdr_hyper(nfsrv_owner_minor, tl); /* Owner Minor */
+ if (nfsrv_owner_major[0] != 0)
+ s = nfsrv_owner_major;
+ else
+ s = nd->nd_cred->cr_prison->pr_hostuuid;
+ nfsm_strtom(nd, s, strlen(s)); /* Owner Major */
+ if (nfsrv_scope[0] != 0)
+ s = nfsrv_scope;
+ else
+ s = nd->nd_cred->cr_prison->pr_hostuuid;
+ nfsm_strtom(nd, s, strlen(s) ); /* Scope */
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(1);
(void)nfsm_strtom(nd, "freebsd.org", strlen("freebsd.org"));

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 3:18 AM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14688986
Default Alt Text
D31952.diff (2 KB)

Event Timeline