]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/nfsd/nfsd.c
nfsidmap: Added Error Logging
[nfs-utils.git] / utils / nfsd / nfsd.c
index 1cda1e59ca0521b4b6203de8b5d33edb94dc1559..8bc5d3ad9afc5b962164d188354c8587d29b545c 100644 (file)
 #include "nfssvc.h"
 #include "xlog.h"
 
-/*
- * IPv6 support for nfsd was finished before some of the other daemons (mountd
- * and statd in particular). That could be a problem in the future if someone
- * were to boot a kernel that supports IPv6 serving with  an older nfs-utils. For
- * now, hardcode the IPv6 switch into the off position until the other daemons
- * are functional.
- */
-#undef IPV6_SUPPORTED
-
 static void    usage(const char *);
 
 static struct option longopts[] =
@@ -103,7 +94,7 @@ main(int argc, char **argv)
        char *p, *progname, *port;
        char *haddr = NULL;
        int     socket_up = 0;
-       int minorvers4 = NFSD_MAXMINORVERS4;    /* nfsv4 minor version */
+       int minorvers41 = 0;    /* nfsv4 minor version */
        unsigned int versbits = NFSCTL_ALLBITS;
        unsigned int protobits = NFSCTL_ALLBITS;
        unsigned int proto4 = 0;
@@ -163,7 +154,12 @@ main(int argc, char **argv)
                        switch((c = strtol(optarg, &p, 0))) {
                        case 4:
                                if (*p == '.') {
-                                       minorvers4 = -atoi(p + 1);
+                                       int i = atoi(p+1);
+                                       if (i != 1) {
+                                               fprintf(stderr, "%s: unsupported minor version\n", optarg);
+                                               exit(1);
+                                       }
+                                       minorvers41 = -1;
                                        break;
                                }
                        case 3:
@@ -246,6 +242,9 @@ main(int argc, char **argv)
                exit(1);
        }
 
+       /* make sure nfsdfs is mounted if it's available */
+       nfssvc_mount_nfsdfs(progname);
+
        /* can only change number of threads if nfsd is already up */
        if (nfssvc_inuse()) {
                socket_up = 1;
@@ -257,7 +256,7 @@ main(int argc, char **argv)
         * registered with rpcbind. Note that on older kernels w/o the right
         * interfaces, these are a no-op.
         */
-       nfssvc_setvers(versbits, minorvers4);
+       nfssvc_setvers(versbits, minorvers41);
  
        error = nfssvc_set_sockets(AF_INET, proto4, haddr, port);
        if (!error)