Most operations require root access. Rather than ensure we generate
the right error message when something fails because we aren't root,
check early.
Note that "--examine" does not necessarily require root, so test
for that first.
Resolves-Debian-bug: 396570
Signed-off-by: NeilBrown <neilb@suse.de>
}
}
+ if ((mode != MISC || devmode != 'E') &&
+ geteuid() != 0) {
+ fprintf(stderr, Name ": must be super-user to perform this action\n");
+ exit(1);
+ }
+
ident.autof = autof;
rv = 0;