Hello community,
here is the log from the commit of package insserv for openSUSE:Factory
checked in at Mon Aug 17 15:42:25 CEST 2009.
--------
--- insserv/insserv.changes 2009-07-23 11:30:40.000000000 +0200
+++ /mounts/work_src_done/STABLE/insserv/insserv.changes 2009-08-17 15:08:08.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Aug 17 14:55:39 CEST 2009 - werner@suse.de
+
+- Loops within /etc/insserv.conf are real errors
+- The system facility $all is special
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ insserv.spec ++++++
--- /var/tmp/diff_new_pack.brsWwa/_old 2009-08-17 15:40:13.000000000 +0200
+++ /var/tmp/diff_new_pack.brsWwa/_new 2009-08-17 15:40:13.000000000 +0200
@@ -24,7 +24,7 @@
Provides: aaa_base:/sbin/insserv
AutoReqProv: on
Version: 1.12.0
-Release: 29
+Release: 30
Summary: A Program to Arrange Initialization Scripts
Source0: insserv-%{version}.tar.bz2
Source1: insserv.conf
++++++ insserv-1.12.0.dif ++++++
--- /var/tmp/diff_new_pack.brsWwa/_old 2009-08-17 15:40:13.000000000 +0200
+++ /var/tmp/diff_new_pack.brsWwa/_new 2009-08-17 15:40:13.000000000 +0200
@@ -73,7 +73,7 @@
.SH EXIT CODES
The exit codes have the following conditions:
--- insserv.c
-+++ insserv.c 2009-07-23 10:55:54.245901384 +0200
++++ insserv.c 2009-08-17 14:00:25.841900763 +0200
@@ -38,6 +38,9 @@
# include
# include
@@ -108,7 +108,15 @@
} attribute((aligned(sizeof(regex_t)))) reg_t;
typedef struct creg_struct {
-@@ -290,6 +296,8 @@ static void rememberreq(service_t * rest
+@@ -216,6 +222,7 @@ typedef struct string {
+
+ typedef struct repl {
+ list_t r_list;
++ ushort flags;
+ string_t r[1];
+ } __align repl_t;
+ #define getrepl(arg) list_entry((arg), struct repl, r_list)
+@@ -290,6 +297,8 @@ static void rememberreq(service_t * rest
requires(here, need, type);
break;
case '$':
@@ -117,7 +125,7 @@
if (strcasecmp(token, "$all") == 0) {
serv->attr.flags |= SERV_ALL;
break;
-@@ -771,9 +779,6 @@ static inline void makedep(void)
+@@ -771,9 +780,6 @@ static inline void makedep(void)
continue;
#endif /* not MINIMAL_RULES */
@@ -127,7 +135,7 @@
if (serv->start->lvl & LVL_BOOT)
out = boot;
else
-@@ -815,6 +820,10 @@ static inline void makedep(void)
+@@ -815,6 +821,10 @@ static inline void makedep(void)
fprintf(out, " %s", name);
}
} else {
@@ -138,7 +146,7 @@
np_list_for_each(pos, &serv->sort.req) {
req_t * req = getreq(pos);
service_t * dep = req->serv;
-@@ -1132,6 +1141,7 @@ static inline void scan_script_regalloc(
+@@ -1132,6 +1142,7 @@ static inline void scan_script_regalloc(
regcompiler(®.def_start, DEFAULT_START, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
regcompiler(®.def_stop, DEFAULT_STOP, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
regcompiler(®.desc, DESCRIPTION, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
@@ -146,7 +154,7 @@
}
static inline void scan_script_reset(void) attribute((always_inline));
-@@ -1147,6 +1157,7 @@ static inline void scan_script_reset(voi
+@@ -1147,6 +1158,7 @@ static inline void scan_script_reset(voi
xreset(script_inf.default_start);
xreset(script_inf.default_stop);
xreset(script_inf.description);
@@ -154,7 +162,7 @@
}
#define FOUND_LSB_HEADER 0x01
-@@ -1177,6 +1188,7 @@ static uchar scan_lsb_headers(const int
+@@ -1177,6 +1189,7 @@ static uchar scan_lsb_headers(const int
#define default_start script_inf.default_start
#define default_stop script_inf.default_stop
#define description script_inf.description
@@ -162,7 +170,7 @@
info("Loading %s\n", path);
-@@ -1273,6 +1285,14 @@ static uchar scan_lsb_headers(const int
+@@ -1273,6 +1286,14 @@ static uchar scan_lsb_headers(const int
description = empty;
}
@@ -177,7 +185,7 @@
/* Skip scanning below from LSB magic end */
if ((end = strstr(buf, "### END INIT INFO")))
break;
-@@ -1341,6 +1361,7 @@ static uchar scan_lsb_headers(const int
+@@ -1341,6 +1362,7 @@ static uchar scan_lsb_headers(const int
#undef default_start
#undef default_stop
#undef description
@@ -185,7 +193,7 @@
return ret;
}
-@@ -1503,6 +1524,7 @@ static inline void scan_script_regfree()
+@@ -1503,6 +1525,7 @@ static inline void scan_script_regfree()
regfree(®.def_start);
regfree(®.def_stop);
regfree(®.desc);
@@ -193,7 +201,7 @@
}
static struct {
-@@ -1696,6 +1718,11 @@ static void scan_script_locations(const
+@@ -1696,6 +1719,11 @@ static void scan_script_locations(const
}
lsb = scan_script_defaults(dfd, d->d_name, override_path, &name, true, ignore);
@@ -205,7 +213,7 @@
if (!script_inf.provides || script_inf.provides == empty)
script_inf.provides = xstrdup(ptr);
-@@ -1776,6 +1803,9 @@ static void scan_script_locations(const
+@@ -1776,6 +1804,9 @@ static void scan_script_locations(const
if (script_inf.stop_after && script_inf.stop_after != empty) {
reversereq(service, REQ_SHLD|REQ_KILL, script_inf.stop_after);
}
@@ -215,7 +223,7 @@
}
if (name)
-@@ -2028,33 +2058,26 @@ static void expand_faci(list_t *restrict
+@@ -2028,33 +2059,32 @@ static void expand_faci(list_t *restrict
goto out;
}
@@ -226,6 +234,10 @@
-
list_for_each_safe(tmp, safe, ptr) {
repl_t * rnxt = getrepl(tmp);
++ if (rnxt->flags & 0x0001) {
++ error("Loop detected during expanding system facilities in the insserv.conf file(s): %s\n",
++ rnxt->r[0].name);
++ }
if (*rnxt->r[0].name == '$') {
- expand_faci(tmp, head, deep);
- } else {
@@ -246,7 +258,9 @@
+ goto out;
}
+ (*deep)++;
++ rnxt->flags |= 0x0001;
+ expand_faci(tmp, head, deep);
++ rnxt->flags &= ~0x0001;
+ (*deep)--;
+ } else if (*deep > 0) {
+ repl_t *restrict subst;
@@ -262,7 +276,21 @@
return;
}
-@@ -2114,6 +2137,7 @@ static inline char * scan_for(DIR *const
+@@ -2064,9 +2094,12 @@ static inline void expand_conf(void)
+ list_for_each(ptr, sysfaci_start) {
+ list_t * rlist, * safe, * head = &getfaci(ptr)->replace;
+ list_for_each_safe(rlist, safe, head) {
+- if (*getrepl(rlist)->r[0].name == '$') {
++ repl_t * tmp = getrepl(rlist);
++ if (*tmp->r[0].name == '$') {
+ int deep = 0;
++ tmp->flags |= 0x0001;
+ expand_faci(rlist, rlist, &deep);
++ tmp->flags &= ~0x0001;
+ }
+ }
+ }
+@@ -2114,6 +2147,7 @@ static inline char * scan_for(DIR *const
static inline boolean underrpm(void)
{
boolean ret = false;
@@ -270,7 +298,7 @@
const pid_t pp = getppid();
char buf[PATH_MAX], *argv[3], *ptr;
# if defined(USE_RPMLIB) && (USE_RPMLIB > 0)
-@@ -2123,8 +2147,15 @@ static inline boolean underrpm(void)
+@@ -2123,8 +2157,15 @@ static inline boolean underrpm(void)
ssize_t len;
snprintf(buf, sizeof(buf)-1, "/proc/%lu/cmdline", (unsigned long)pp);
@@ -288,7 +316,7 @@
memset(buf, '\0', sizeof(buf));
if ((len = read(fd , buf, sizeof(buf)-1)) < 0)
-@@ -2185,6 +2216,8 @@ static inline boolean underrpm(void)
+@@ -2185,6 +2226,8 @@ static inline boolean underrpm(void)
out:
if (fd >= 0)
close(fd);
@@ -297,7 +325,7 @@
return ret;
}
-@@ -2238,6 +2271,7 @@ int main (int argc, char *argv[])
+@@ -2238,6 +2281,7 @@ int main (int argc, char *argv[])
boolean del = false;
boolean defaults = false;
boolean ignore = false;
@@ -305,7 +333,7 @@
myname = basename(*argv);
-@@ -2305,7 +2339,9 @@ int main (int argc, char *argv[])
+@@ -2305,7 +2349,9 @@ int main (int argc, char *argv[])
argv += optind;
argc -= optind;
@@ -316,7 +344,7 @@
error("usage: %s [[-r] init_script|init_directory]\n", myname);
if (*argv) {
-@@ -2357,7 +2393,19 @@ int main (int argc, char *argv[])
+@@ -2357,7 +2403,19 @@ int main (int argc, char *argv[])
if (strcmp(path, INITDIR) != 0) {
char * tmp;
@@ -337,7 +365,7 @@
if ((tmp = strstr(root, INITDIR))) {
*tmp = '\0';
} else {
-@@ -2490,17 +2538,45 @@ int main (int argc, char *argv[])
+@@ -2490,17 +2548,45 @@ int main (int argc, char *argv[])
/*
* Scan now all scripts found in the init.d/ directory
*/
@@ -385,7 +413,7 @@
if (*d->d_name == '.')
continue;
errno = 0;
-@@ -2807,6 +2883,9 @@ int main (int argc, char *argv[])
+@@ -2807,6 +2893,9 @@ int main (int argc, char *argv[])
if (script_inf.should_stop && script_inf.should_stop != empty) {
rememberreq(service, REQ_SHLD|REQ_KILL, script_inf.should_stop);
}
@@ -395,7 +423,7 @@
}
if (script_inf.start_before && script_inf.start_before != empty) {
-@@ -2985,16 +3064,17 @@ int main (int argc, char *argv[])
+@@ -2985,16 +3074,17 @@ int main (int argc, char *argv[])
char * ptr = argr[curr_argc];
struct _mark {
const char * wrd;
@@ -418,7 +446,7 @@
};
for (c = 0; mark[c].wrd; c++) {
-@@ -3016,6 +3096,14 @@ int main (int argc, char *argv[])
+@@ -3016,6 +3106,14 @@ int main (int argc, char *argv[])
char * ptr = mark[c].order + len - 1;
if (*ptr == ',') *ptr = '\0';
}
@@ -433,6 +461,29 @@
xreset(*(mark[c].str));
*(mark[c].str) = xstrdup(mark[c].order);
}
+--- listing.c
++++ listing.c 2009-08-17 14:15:48.893900934 +0200
+@@ -364,6 +364,7 @@ static void __follow (dir_t *restrict di
+ * Do not count the dependcy deep of the system facilities
+ * but follow them to count the replacing provides.
+ */
++
+ if (*ptmp->name == '$')
+ warn("System facilities not fully expanded, see %s!\n", dir->name);
+ else if (++deep > MAX_DEEP) {
+@@ -398,6 +399,12 @@ static void __follow (dir_t *restrict di
+ break; /* Loop detected, stop recursion */
+ }
+
++ if ((mode == 'S') && (attof(tmp)->flags & SERV_ALL)) {
++ warn("%s depends on %s and therefore on system facility `$all' which can not be true!\n",
++ target->script ? target->script : target->name, tmp->script ? tmp->script : tmp->name);
++ continue;
++ }
++
+ if (ptrg->deep >= deep) /* Nothing new */
+ continue;
+ /* The inner recursion */
--- listing.h
+++ listing.h 2009-07-02 10:48:50.789901632 +0200
@@ -92,7 +92,7 @@ static inline void prefetch(const void *
@@ -444,3 +495,55 @@
#define strsize(string) ((strlen(string)+1)*sizeof(char))
typedef struct list_struct {
+--- tests/suite
++++ tests/suite 2009-08-17 11:24:02.497901719 +0200
+@@ -79,6 +79,22 @@ else
+ $time hwclock
+ <interactive> udev mountdevsubfs checkroot checkfs console-screen
+ EOF
++ update_conf ()
++ {
++ set +C
++ cat <<-'EOF' > $insconf
++ $local_fs +mountall +umountfs
++ $network +networking +ifupdown
++ $named +named +dnsmasq +lwresd +bind9 $network
++ $remote_fs $local_fs +mountnfs +mountnfs-bootclean +umountnfs +sendsigs
++ $syslog +syslog +sysklogd
++ $portmap portmap
++ $time hwclock
++ <interactive> udev mountdevsubfs checkroot checkfs console-screen
++ EOF
++ set -C
++ }
++
+ fi
+ chmod u+w,a+r $insconf
+
+@@ -94,6 +110,12 @@ insserv_del ()
+ $insserv $debug -c $insconf -p $initddir -o $overridedir -r $script
+ }
+
++initdir_purge ()
++{
++ rm -rf ${initddir}/../rc*.d ${initddir}
++ mkdir -p ${initddir}
++}
++
+ relpath ()
+ {
+ local OLDIFS IFS
+@@ -201,6 +223,13 @@ addscript ()
+ chmod u+w,a+rx $script
+ }
+
++remscript ()
++{
++ local scriptname=$1
++ local script=${initddir}/$scriptname
++ rm -f $script
++}
++
+ insertscript ()
+ {
+ local scriptname=$1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org