Restore the check against running as root that I accidentally removed in
r194493.
This commit is contained in:
parent
c28aedefd8
commit
5255c009dd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=194548
@ -91,6 +91,7 @@ static const char *locale_device[] = {
|
||||
#define GZCAT_CMD "z"
|
||||
enum Ziptype {NONE, BZIP, GZIP};
|
||||
|
||||
static uid_t uid;
|
||||
static int starting_dir;
|
||||
static char tmp_file[MAXPATHLEN];
|
||||
struct stat test_st;
|
||||
@ -742,6 +743,14 @@ main(int argc, char **argv)
|
||||
{
|
||||
int opt;
|
||||
|
||||
if ((uid = getuid()) == 0) {
|
||||
fprintf(stderr, "don't run %s as root, use:\n echo", argv[0]);
|
||||
for (optind = 0; optind < argc; optind++) {
|
||||
fprintf(stderr, " %s", argv[optind]);
|
||||
}
|
||||
fprintf(stderr, " | nice -5 su -m man\n");
|
||||
exit(1);
|
||||
}
|
||||
while ((opt = getopt(argc, argv, "vnfLrh")) != -1) {
|
||||
switch (opt) {
|
||||
case 'f':
|
||||
|
Loading…
Reference in New Issue
Block a user