]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/mount.c
Support -s option to ignore unknown options (sloppy)
[nfs-utils.git] / utils / mount / mount.c
index 6717941621c9b1e622f7b467c2e273a9d69081d3..7d58ef67ce36a023969d53d8f82769e9ec2e0c1a 100644 (file)
@@ -43,6 +43,7 @@ char *progname;
 int nomtab;
 int verbose;
 int mounttype;
+int sloppy;
 
 static struct option longopts[] = {
   { "fake", 0, 0, 'f' },
@@ -190,6 +191,7 @@ void mount_usage()
        printf("\t-w\t\tMount file system read-write\n");
        printf("\t-f\t\tFake mount, don't actually mount\n");
        printf("\t-n\t\tDo not update /etc/mtab\n");
+       printf("\t-s\t\tTolerate sloppy mount options rather than failing.\n");
        printf("\t-h\t\tPrint this help\n");
        printf("\tversion\t\tnfs4 - NFS version 4, nfs - older NFS version supported\n");
        printf("\tnfsoptions\tRefer mount.nfs(8) or nfs(5)\n\n");
@@ -295,7 +297,7 @@ int main(int argc, char *argv[])
                        umount_usage();
                        exit(1);
                }
-               return(nfsumount(argc, argv));
+               exit(nfsumount(argc, argv) ? 0 : 1);
        }
 
        if ((argc < 2)) {
@@ -311,7 +313,7 @@ int main(int argc, char *argv[])
                return 0;
        }
 
-       while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:h",
+       while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:hs",
                                longopts, NULL)) != -1) {
                switch (c) {
                case 'r':
@@ -341,6 +343,9 @@ int main(int argc, char *argv[])
                        else
                                mount_opts = xstrdup(optarg);
                        break;
+               case 's':
+                       ++sloppy;
+                       break;
                case 128: /* bind */
                        mounttype = MS_BIND;
                        break;