]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/mount.c
mount.nfs: Fix issue with -o user,exec
[nfs-utils.git] / utils / mount / mount.c
index 487c0a62bc20f5d7edf02a72334423c1ee30702a..4698d85fd98f6f9cd30c00f8644dff26ceb41082 100644 (file)
@@ -99,11 +99,9 @@ static const struct opt_map opt_map[] = {
   { "rbind",    0, 0, MS_BIND|MS_REC }, /* Idem, plus mounted subtrees */
   { "auto",     0, 0, MS_DUMMY },       /* Can be mounted using -a */
   { "noauto",   0, 0, MS_DUMMY },       /* Can  only be mounted explicitly */
-  { "users",    1, 0, MS_USERS|MS_NOEXEC|MS_NOSUID|MS_NODEV  },
-                                       /* Allow ordinary user to mount */
+  { "users",    1, 0, MS_USERS },      /* Allow ordinary user to mount */
   { "nousers",  0, 1, MS_DUMMY  },      /* Forbid ordinary user to mount */
-  { "user",     1, 0, MS_USER|MS_NOEXEC|MS_NOSUID|MS_NODEV  },
-                                       /* Allow ordinary user to mount */
+  { "user",     1, 0, MS_USER  },      /* Allow ordinary user to mount */
   { "nouser",   0, 1, MS_DUMMY   },     /* Forbid ordinary user to mount */
   { "owner",    0, 0, MS_DUMMY  },      /* Let the owner of the device mount */
   { "noowner",  0, 0, MS_DUMMY  },      /* Device owner has no special privs */
@@ -262,7 +260,7 @@ static void parse_opts (const char *options, int *flags, char **extra_opts)
        if (options != NULL) {
                char *opts = xstrdup(options);
                char *opt, *p;
-               int len = strlen(opts);
+               int len = strlen(opts) + 1;             /* include room for a null */
                int open_quote = 0;
 
                *extra_opts = xmalloc(len);
@@ -437,7 +435,7 @@ int main(int argc, char *argv[])
                exit(1);
        }
 
-       if (strcmp(progname, "mount.nfsv4") == 0)
+       if (strcmp(progname, "mount.nfs4") == 0)
                nfs_mount_vers = 4;
 
        if (uid != 0) {