summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/include/nfs/nfs.h3
-rw-r--r--support/include/nfslib.h2
-rw-r--r--support/nfs/nfssvc.c13
3 files changed, 13 insertions, 5 deletions
diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h
index fc26f4e..00b0028 100644
--- a/support/include/nfs/nfs.h
+++ b/support/include/nfs/nfs.h
@@ -13,6 +13,9 @@
#define NFSD_MINVERS 2
#define NFSD_MAXVERS 4
+#define NFSD_MINMINORVERS4 1
+#define NFSD_MAXMINORVERS4 1
+
struct nfs_fh_len {
int fh_size;
u_int8_t fh_handle[NFS3_FHSIZE];
diff --git a/support/include/nfslib.h b/support/include/nfslib.h
index 9d0d39d..ae98650 100644
--- a/support/include/nfslib.h
+++ b/support/include/nfslib.h
@@ -130,7 +130,7 @@ int wildmat(char *text, char *pattern);
* nfsd library functions.
*/
int nfsctl(int, struct nfsctl_arg *, union nfsctl_res *);
-int nfssvc(int port, int nrservs, unsigned int versbits, unsigned int portbits, char *haddr);
+int nfssvc(int port, int nrservs, unsigned int versbits, int minorvers4, unsigned int portbits, char *haddr);
int nfsaddclient(struct nfsctl_client *clp);
int nfsdelclient(struct nfsctl_client *clp);
int nfsexport(struct nfsctl_export *exp);
diff --git a/support/nfs/nfssvc.c b/support/nfs/nfssvc.c
index 9bbc9a5..33c15a7 100644
--- a/support/nfs/nfssvc.c
+++ b/support/nfs/nfssvc.c
@@ -116,7 +116,7 @@ nfssvc_setfds(int port, unsigned int ctlbits, char *haddr)
return;
}
static void
-nfssvc_versbits(unsigned int ctlbits)
+nfssvc_versbits(unsigned int ctlbits, int minorvers4)
{
int fd, n, off;
char buf[BUFSIZ], *ptr;
@@ -133,6 +133,11 @@ nfssvc_versbits(unsigned int ctlbits)
else
off += snprintf(ptr+off, BUFSIZ - off, "-%d ", n);
}
+ n = minorvers4 >= 0 ? minorvers4 : -minorvers4;
+ if (n >= NFSD_MINMINORVERS4 && n <= NFSD_MAXMINORVERS4)
+ off += snprintf(ptr+off, BUFSIZ - off, "%c4.%d",
+ minorvers4 > 0 ? '+' : '-',
+ n);
snprintf(ptr+off, BUFSIZ - off, "\n");
if (write(fd, buf, strlen(buf)) != strlen(buf)) {
syslog(LOG_ERR, "nfssvc: Setting version failed: errno %d (%s)",
@@ -143,8 +148,8 @@ nfssvc_versbits(unsigned int ctlbits)
return;
}
int
-nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits,
- char *haddr)
+nfssvc(int port, int nrservs, unsigned int versbits, int minorvers4,
+ unsigned protobits, char *haddr)
{
struct nfsctl_arg arg;
int fd;
@@ -153,7 +158,7 @@ nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits,
* the ports get registered with portmap against correct
* versions
*/
- nfssvc_versbits(versbits);
+ nfssvc_versbits(versbits, minorvers4);
nfssvc_setfds(port, protobits, haddr);
fd = open(NFSD_THREAD_FILE, O_WRONLY);