]> err.no Git - util-linux/commitdiff
Merge commit 'origin/master'
authorLaMont Jones <lamont@debian.org>
Fri, 13 Feb 2009 18:52:12 +0000 (11:52 -0700)
committerLaMont Jones <lamont@debian.org>
Fri, 13 Feb 2009 18:52:12 +0000 (11:52 -0700)
1  2 
mount/Makefile.am
mount/mount.8
mount/mount.c

Simple merge
diff --cc mount/mount.8
Simple merge
diff --cc mount/mount.c
index 9bdc34099fc774faad2ab18d4ff2c4e85d51d99c,23f27d6764784a9222b5df966b432ba3c2caac75..463672a9a55a5e06482939851088de18ba781f6c
@@@ -2037,16 -2027,22 +2047,25 @@@ main(int argc, char *argv[]) 
                return print_all (types);
        }
  
-       if (getuid () != geteuid ()) {
-               suid = 1;
-               if (types || options || readwrite || nomtab || mount_all ||
-                   fake || mounttype || (argc + specseen) != 1)
-                       die (EX_USAGE, _("mount: only root can do that"));
+       {
+               const uid_t ruid = getuid();
+               const uid_t euid = geteuid();
+               /* if we're really root and aren't running setuid */
+               if (((uid_t)0 == ruid) && (ruid == euid)) {
+                       restricted = 0;
+               }
+       }
+       if (restricted &&
+           (types || options || readwrite || nomtab || mount_all ||
+            fake || mounttype || (argc + specseen) != 1)) {
+               die (EX_USAGE, _("mount: only root can do that"));
        }
  
 +      if (keysize && sscanf(keysize,"%d",&keysz) != 1)
 +              die (EX_USAGE, _("mount: argument to --keybits or -k must be a number"));
 +
        atexit(unlock_mtab);
  
        switch (argc+specseen) {