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) {