X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnfsumount.c;h=e65f58f0122374ad92f881d96e7072a9f0fbe03e;hp=81d0d3a72c4ea5ca1a1230e3991b33fc38f38164;hb=b3b111b1bd5fbc678419bf1964b6093045081139;hpb=b8b6a251c372b134e66d0f436bf2c6231cc1c055 diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c index 81d0d3a..e65f58f 100644 --- a/utils/mount/nfsumount.c +++ b/utils/mount/nfsumount.c @@ -341,6 +341,11 @@ int nfsumount(int argc, char *argv[]) if (getuid() != 0) { /* only permitted if "user=" or "users" is in mount options */ if (!mc) { + /* umount might call us twice. The second time there will + * be no entry in mtab and we should just exit quietly + */ + return 0; + only_root: fprintf(stderr,"%s: You are not permitted to unmount %s\n", progname, spec); @@ -353,7 +358,7 @@ int nfsumount(int argc, char *argv[]) int len; if (!opt) goto only_root; - if (opt[5] != '=') + if (opt[4] != '=') goto only_root; comma = strchr(opt, ','); if (comma)