[Pkg-sysvinit-commits] r1451 - in sysvinit-upstream/trunk: doc man src

Petter Reinholdtsen pere at alioth.debian.org
Sun Jul 12 15:03:08 UTC 2009


Author: pere
Date: 2009-07-12 15:03:07 +0000 (Sun, 12 Jul 2009)
New Revision: 1451

Modified:
   sysvinit-upstream/trunk/doc/Changelog
   sysvinit-upstream/trunk/man/shutdown.8
   sysvinit-upstream/trunk/src/shutdown.c
Log:
Change shutdown to only accept flags -H and -P with the -h flag,
and document this requirement in the manual page.


Modified: sysvinit-upstream/trunk/doc/Changelog
===================================================================
--- sysvinit-upstream/trunk/doc/Changelog	2009-07-12 14:59:06 UTC (rev 1450)
+++ sysvinit-upstream/trunk/doc/Changelog	2009-07-12 15:03:07 UTC (rev 1451)
@@ -77,6 +77,8 @@
     pages in memory to avoid paging when user processes are stopped.
     Patch from Debian and Goswin von Brederlow with changes by Kel
     Modderman.
+  * Change shutdown to only accept flags -H and -P with the -h flag,
+    and document this requirement in the manual page.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri, 30 Jul 2004 14:14:58 +0200
 

Modified: sysvinit-upstream/trunk/man/shutdown.8
===================================================================
--- sysvinit-upstream/trunk/man/shutdown.8	2009-07-12 14:59:06 UTC (rev 1450)
+++ sysvinit-upstream/trunk/man/shutdown.8	2009-07-12 15:03:07 UTC (rev 1451)
@@ -58,8 +58,8 @@
 .\"}}}
 .\"{{{  -H
 .IP \fB\-H\fP
-Halt action is to halt or drop into boot monitor on systems that
-support it.
+Modifier to the -h flag.  Halt action is to halt or drop into boot
+monitor on systems that support it.  Must be used with the -h flag.
 .\"}}}
 .\"{{{  -P
 .IP \fB\-P\fP

Modified: sysvinit-upstream/trunk/src/shutdown.c
===================================================================
--- sysvinit-upstream/trunk/src/shutdown.c	2009-07-12 14:59:06 UTC (rev 1450)
+++ sysvinit-upstream/trunk/src/shutdown.c	2009-07-12 15:03:07 UTC (rev 1451)
@@ -521,6 +521,12 @@
   		}
 	}
 
+	if (NULL != halttype && down_level[0] != '0') {
+		fprintf(stderr, "shutdown: -H and -P flags can only be used along with -h flag.\n");
+		usage();
+  		exit(1);
+	}
+
 	/* Do we need to use the shutdown.allow file ? */
 	if (useacl && (fp = fopen(SDALLOW, "r")) != NULL) {
 




More information about the Pkg-sysvinit-commits mailing list