[Initscripts-ng-commits] r576 - in /trunk/src/insserv/debian: changelog patches/40_segfault_virtprov.dpatch

pere at users.alioth.debian.org pere at users.alioth.debian.org
Fri Feb 1 18:46:41 UTC 2008


Author: pere
Date: Fri Feb  1 18:46:41 2008
New Revision: 576

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=576
Log:
  * Rewrote patch debian/patches/40_segfault_virtprov.dpatch with a solution
    provided by upstream.

Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/patches/40_segfault_virtprov.dpatch

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=576&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Fri Feb  1 18:46:41 2008
@@ -1,3 +1,10 @@
+insserv (1.11.0-3) UNRELEASED; urgency=low
+
+  * Rewrote patch debian/patches/40_segfault_virtprov.dpatch with a solution
+    provided by upstream.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Fri,  1 Feb 2008 19:45:46 +0100
+
 insserv (1.11.0-2) unstable; urgency=low
 
   * Changed patch 31_debian_conf to accept rsyslog and syslog-ng as

Modified: trunk/src/insserv/debian/patches/40_segfault_virtprov.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/40_segfault_virtprov.dpatch?rev=576&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/40_segfault_virtprov.dpatch (original)
+++ trunk/src/insserv/debian/patches/40_segfault_virtprov.dpatch Fri Feb  1 18:46:41 2008
@@ -5,31 +5,85 @@
 facility.
 
 @DPATCH@
---- insserv-1.11.0.orig/insserv.c
-+++ insserv-1.11.0/insserv.c
-@@ -2856,7 +2861,8 @@
- 	 */
- 	while ((d = readdir(rcdir)) != (struct dirent*)0) {
- 	    const char * ptr = d->d_name;
--	    serv_t * serv;
-+	    serv_t * serv = 0;
-+	    const char * prov;
+--- insserv/insserv.c
++++ insserv/insserv.c	2008-02-01 11:43:45.634618329 +0100
+@@ -166,7 +166,7 @@ typedef struct pwd_struct {
  
- 	    if (*ptr != 'S' && *ptr != 'K')
- 		continue;
-@@ -2865,11 +2871,14 @@
- 	    if (strspn(ptr, "0123456789") != 2)
- 		continue;
- 	    ptr += 2;
--	    serv = findserv(getprovides(ptr));
+ static list_t pwd = { &(pwd), &(pwd) }, * topd = &(pwd);
  
- 	    if (stat(d->d_name, &st_script) < 0)
- 		xremove(d->d_name);	/* dangling sym link */
+-static void pushd(const char *const __restrict path);
++static void pushd(const char *const __restrict path) __attribute__((nonnull(1)));
+ static void pushd(const char *const path)
+ {
+     pwd_t *  dir;
+@@ -305,13 +305,13 @@ out:
+     return getserv(ptr);
+ }
  
-+	    prov = getprovides(ptr);
-+	    if (prov)
-+	        serv = findserv(prov);
+-static serv_t * findserv(const char *const __restrict serv) __attribute__((nonnull(1)));
++static serv_t * findserv(const char *const __restrict serv);
+ static serv_t * findserv(const char *const serv)
+ {
+     list_t * ptr;
+     serv_t * ret = (serv_t*)0;
+ 
+-    if (!serv)
++    if (serv == (const char*)0)
+ 	goto out;
+ 
+     list_for_each(ptr, serv_start) {
+@@ -334,6 +334,9 @@ static void rememberreq(serv_t *serv, ui
+     list_t * ptr;
+     uint old = bit;
+ 
++    if (!tmp)
++	error("%s", strerror(errno));
 +
- 	    if (!serv) continue;
+     while ((token = strsep(&tmp, delimeter))) {
+ 	boolean found = false;
+ 	req_t * this;
+@@ -399,6 +402,9 @@ static void reversereq(const serv_t * se
+     char * rev = strdupa(list);
+     uint old = bit;
  
- 	    if (defaults && !(serv->opts & SERV_ENABLED))
++    if (!rev)
++	error("%s", strerror(errno));
++
+     while ((dep = strsep(&rev, delimeter)) && *dep) {
+ 	serv_t * tmp;
+ 	list_t * ptr;
+@@ -437,7 +443,7 @@ static void reversereq(const serv_t * se
+ /*
+  * Check required services for name
+  */
+-static boolean chkrequired(const char *const __restrict name) __attribute__((nonnull(1)));
++static boolean chkrequired(const char *const __restrict name);
+ static boolean chkrequired(const char *const name)
+ {
+     serv_t * serv = findserv(name);
+--- insserv/listing.h
++++ insserv/listing.h	2008-02-01 11:40:45.347748072 +0100
+@@ -97,11 +97,11 @@ extern int makeprov(const char *__restri
+ extern void setorder(const char *__restrict script, const int order, boolean recursive) __attribute__((nonnull(1)));
+ extern int getorder(const char *__restrict script) __attribute__((nonnull(1)));
+ extern boolean notincluded(const char *__restrict script, const int runlevel) __attribute__((nonnull(1)));
+-extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(1,2)));
+-extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1,2)));
++extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(2)));
++extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1)));
+ extern const char * getscript(const char *__restrict prov) __attribute__((nonnull(1)));
+ extern const char * getprovides(const char *__restrict script) __attribute__((nonnull(1)));
+-extern boolean listscripts(const char **__restrict script, const int lvl) __attribute__((nonnull(1)));
++extern boolean listscripts(const char **__restrict script, const int lvl);
+ extern int maxorder;
+ extern boolean is_loop_detected(void);
+ 
+@@ -116,7 +116,7 @@ extern int map_has_runlevels(void);
+ extern int map_runlevel_to_lvl (const int runlevel);
+ extern int map_key_to_lvl(const char key);
+ 
+-static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline,nonnull(1)));
++static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline));
+ static inline char * xstrdup(const char * s)
+ {
+     char * r;




More information about the Initscripts-ng-commits mailing list