Print usage information when shutdown is used by non-root user. Patch from Mike Frysinger and Gentoo.

This commit is contained in:
Petter Reinholdtsen 2009-11-14 21:35:42 +00:00
parent 78f4178c4d
commit 6bf849d01d
2 changed files with 3 additions and 0 deletions

View File

@ -12,6 +12,8 @@ sysvinit (2.88dsf) UNRELEASED; urgency=low
* Change tty handling in init to make sure the UTF-8 flag is not cleared
on boot. Patch from Samuel Thibault.
* Add Makefile in toplevel directory.
* Print usage information when shutdown is used by non-root user.
Patch from Mike Frysinger and Gentoo.
-- Petter Reinholdtsen <pere@hungry.com> Sun, 12 Jul 2009 19:58:10 +0200

View File

@ -469,6 +469,7 @@ int main(int argc, char **argv)
if (getuid() != 0) {
fprintf(stderr, "shutdown: you must be root to do that!\n");
usage();
exit(1);
}
strcpy(down_level, "1");