From 6bf849d01d3dbe2b4ad19d56b1e0d09eff2f8acc Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sat, 14 Nov 2009 21:35:42 +0000 Subject: [PATCH] Print usage information when shutdown is used by non-root user. Patch from Mike Frysinger and Gentoo. --- doc/Changelog | 2 ++ src/shutdown.c | 1 + 2 files changed, 3 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index f609d2b..fa20fa5 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 Sun, 12 Jul 2009 19:58:10 +0200 diff --git a/src/shutdown.c b/src/shutdown.c index a950209..093a053 100644 --- a/src/shutdown.c +++ b/src/shutdown.c @@ -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");