* src/login.c: Check if login is run with effective root
privileges. This should be more helpful to users than a failure to find an utmp entry or failure to access a file.
This commit is contained in:
parent
a0503bc3a1
commit
efcbbc3d74
@ -1,3 +1,9 @@
|
||||
2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/login.c: Check if login is run with effective root
|
||||
privileges. This should be more helpful to users than a failure to
|
||||
find an utmp entry or failure to access a file.
|
||||
|
||||
2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/utmp.c: Reworked. Get rid of Linux specific stuff. Get rid
|
||||
|
@ -510,6 +510,11 @@ int main (int argc, char **argv)
|
||||
amroot = (getuid () == 0);
|
||||
Prog = Basename (argv[0]);
|
||||
|
||||
if (geteuid() != 0) {
|
||||
fprintf (stderr, _("%s: Cannot possibly work without effective root\n"), Prog);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
process_flags (argc, argv);
|
||||
|
||||
if ((isatty (0) == 0) || (isatty (1) == 0) || (isatty (2) == 0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user