[Initscripts-ng-commits] r447 - in /trunk/src/insserv/debian: changelog patches/00list patches/45_loopsarefatal.dpatch

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sat Jan 5 09:24:52 UTC 2008


Author: pere
Date: Sat Jan  5 09:24:52 2008
New Revision: 447

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=447
Log:
  * New test to check that scripts introducing a loop (or a fake loop,
    see bug #458582) will refuse to install.
  * New patch 45_loopsarefatal to make sure insserv considering all
    kind of loops fatal.

Added:
    trunk/src/insserv/debian/patches/45_loopsarefatal.dpatch
Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/patches/00list

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=447&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sat Jan  5 09:24:52 2008
@@ -8,6 +8,10 @@
     override default files if the script is lacking an LSB header.
   * Moved default dependency values from patch 21_overrides to
     41_debiandefault where it belong.
+  * New test to check that scripts introducing a loop (or a fake loop,
+    see bug #458582) will refuse to install.
+  * New patch 45_loopsarefatal to make sure insserv considering all
+    kind of loops fatal.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri,  4 Jan 2008 16:41:28 +0100
 

Modified: trunk/src/insserv/debian/patches/00list
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/00list?rev=447&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/00list (original)
+++ trunk/src/insserv/debian/patches/00list Sat Jan  5 09:24:52 2008
@@ -12,3 +12,4 @@
 42_redundantlvl
 43_shutdown
 44_reportloopmemb
+45_loopsarefatal

Added: trunk/src/insserv/debian/patches/45_loopsarefatal.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/45_loopsarefatal.dpatch?rev=447&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/45_loopsarefatal.dpatch (added)
+++ trunk/src/insserv/debian/patches/45_loopsarefatal.dpatch Sat Jan  5 09:24:52 2008
@@ -1,0 +1,58 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 45_loopsarefatal.dpatch by Petter Reinholdtsen
+
+To avoid introducing broken boot and shutdown sequences, it is
+important that no loops are detected when inserting a script.  This
+patch is a naive fix to make sure any loop detected is a fatal error.
+The alternative is a broken boot or shutdown sequence.
+
+It will also report "fake loops" as described in #458582 as fatal, but
+that is intentional as these fake loops also confuse insserv to a
+point where its generated boot and shutdown sequence is broken.
+
+ at DPATCH@
+diff -urNad insserv~/insserv.c insserv/insserv.c
+--- insserv~/insserv.c	2008-01-05 10:17:45.000000000 +0100
++++ insserv/insserv.c	2008-01-05 10:18:31.000000000 +0100
+@@ -2385,6 +2385,9 @@
+      */
+     follow_all();
+ 
++    if (is_loop_detected())
++	error("exiting now!\n");
++
+     /*
+      * Re-order some well known scripts to get
+      * a more stable order collection.
+diff -urNad insserv~/listing.c insserv/listing.c
+--- insserv~/listing.c	2008-01-05 10:17:45.000000000 +0100
++++ insserv/listing.c	2008-01-05 10:17:45.000000000 +0100
+@@ -415,6 +415,17 @@
+     }
+ }
+ 
++boolean is_loop_detected(void)
++{
++    list_t *tmp;
++    list_for_each(tmp, d_start) {
++	dir_t * dir = getdir(tmp);
++	if (dir->flags & DIR_LOOPREPORT)
++	    return true;
++    }
++    return false;
++}
++
+ /*
+  * For debuging: show all services
+  */
+diff -urNad insserv~/listing.h insserv/listing.h
+--- insserv~/listing.h	2008-01-05 10:17:43.000000000 +0100
++++ insserv/listing.h	2008-01-05 10:17:45.000000000 +0100
+@@ -88,6 +88,7 @@
+ extern const char * getprovides(const char * script);
+ extern boolean listscripts(const char ** script, const int lvl);
+ extern int maxorder;
++extern boolean is_loop_detected(void);
+ 
+ /*
+  * Common short cuts




More information about the Initscripts-ng-commits mailing list