From: LaMont Jones Date: Sun, 11 Oct 2009 00:48:57 +0000 (-0600) Subject: Merge remote branch 'origin/master' X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c695c487cfaa18a9d73bbf969dbad32677c0d7d2;p=util-linux Merge remote branch 'origin/master' --- c695c487cfaa18a9d73bbf969dbad32677c0d7d2 diff --cc mount/mount.c index fdd56894,23d70cb1..4867f465 --- a/mount/mount.c +++ b/mount/mount.c @@@ -2225,17 -2205,20 +2225,23 @@@ main(int argc, char *argv[]) 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 (restricted && + (types || options || readwrite || nomtab || mount_all || + fake || mounttype || (argc + specseen) != 1)) { + + if (ruid == 0 && euid != 0) + /* user is root, but setuid to non-root */ + die (EX_USAGE, _("mount: only root can do that " + "(effective UID is %d)"), euid); + + 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) {