Print usage information when shutdown is used by non-root user. Patch from Mike Frysi...
authorPetter Reinholdtsen <pere@hungry.com>
Sat, 14 Nov 2009 21:35:42 +0000 (21:35 +0000)
committerPetter Reinholdtsen <pere@hungry.com>
Sat, 14 Nov 2009 21:35:42 +0000 (21:35 +0000)
git-svn-id: svn://svn.sv.gnu.org/sysvinit/sysvinit/trunk@15 456724a4-4300-0410-8514-c89748c515a2

doc/Changelog
src/shutdown.c

index f609d2bae8caf4b593c701489eb8883e86200c7c..fa20fa5a173b0a49afc2854ba0464d31b9672844 100644 (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
 
index a950209e35539073242b966c6b90182bf4374546..093a05395e94ce8b9c01b3aa10fe2abd37baaa61 100644 (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");