* 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);
return;
}
static void
-nfssvc_versbits(unsigned int ctlbits)
+nfssvc_versbits(unsigned int ctlbits, int minorvers4)
{
int fd, n, off;
char buf[BUFSIZ], *ptr;
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)",
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;
* 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);
};
unsigned int protobits = NFSCTL_ALLBITS;
unsigned int versbits = NFSCTL_ALLBITS;
+int minorvers4; /* nfsv4 minor version */
char *haddr = NULL;
int
closeall(3);
openlog("nfsd", LOG_PID, LOG_DAEMON);
- if ((error = nfssvc(port, count, versbits, protobits, haddr)) < 0) {
+ if ((error = nfssvc(port, count, versbits, minorvers4, protobits, haddr)) < 0) {
int e = errno;
syslog(LOG_ERR, "nfssvc: %s", strerror(e));
closelog();