root check

This commit is contained in:
Bjorn Andersson 2006-06-11 12:45:46 +00:00
parent 1e9df58f2f
commit a83a975299
2 changed files with 10 additions and 0 deletions

View File

@ -135,6 +135,11 @@ main(int argc, char **argv)
username = NULL; username = NULL;
if (geteuid() != 0) {
printf("Run as root and you'll be happy.\n");
usage();
}
while ((choice = getopt(argc, argv, "u:")) != -1) { while ((choice = getopt(argc, argv, "u:")) != -1) {
switch(choice) { switch(choice) {
case 'u': case 'u':

View File

@ -132,6 +132,11 @@ main(int argc, char **argv)
username = NULL; username = NULL;
if (geteuid() != 0) {
printf("Run as root and you'll be happy.\n");
usage();
}
while ((choice = getopt(argc, argv, "u:")) != -1) { while ((choice = getopt(argc, argv, "u:")) != -1) {
switch(choice) { switch(choice) {
case 'u': case 'u':