Hello community, here is the log from the commit of package sysvinit for openSUSE:Factory checked in at 2012-03-20 11:36:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sysvinit (Old) and /work/SRC/openSUSE:Factory/.sysvinit.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sysvinit", Maintainer is "wer...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/sysvinit/sysvinit.changes 2012-03-02 13:50:12.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.sysvinit.new/sysvinit.changes 2012-03-20 11:36:17.000000000 +0100 @@ -1,0 +2,10 @@ +Fri Mar 16 16:51:33 UTC 2012 - wer...@suse.de + +- Add two patch from upstream + + Handle deleted binaries in pidof (was upstream bug #34992) + + Allow init to delte extra environment variables (was upstream + bug #35858) + + Avoid that init double environment variables for its childs + (was upstream bug #35855) + +------------------------------------------------------------------- New: ---- sysvinit-2.88+dsf-dostat.patch sysvinit-2.88+dsf-env.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sysvinit.spec ++++++ --- /var/tmp/diff_new_pack.EAbMiK/_old 2012-03-20 11:36:19.000000000 +0100 +++ /var/tmp/diff_new_pack.EAbMiK/_new 2012-03-20 11:36:19.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package sysvinit # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,8 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - Name: sysvinit %define PDVER 2.0.2 @@ -24,13 +22,16 @@ %define SCVER 1.16 %define SIVER 2.88+ %define START 0.58 -License: GPL-2.0+ -Group: System/Base Version: %{SIVER} -Release: 58 +Release: 0 Summary: SysV-Style init +License: GPL-2.0+ +Group: System/Base BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: audit-devel libselinux-devel libsepol-devel pam-devel +BuildRequires: audit-devel +BuildRequires: libselinux-devel +BuildRequires: libsepol-devel +BuildRequires: pam-devel Url: http://savannah.nongnu.org/projects/sysvinit/ Source: sysvinit-%{SIVER}dsf.tar.bz2 Source2: killproc-%{KPVER}.tar.bz2 @@ -52,6 +53,8 @@ Patch7: %{name}-%{version}dsf-crypt.patch Patch8: %{name}-%{version}dsf-blowfish.dif Patch9: %{name}-2.88dsf-no-kill.patch +Patch10: %{name}-%{version}dsf-env.patch +Patch11: %{name}-%{version}dsf-dostat.patch Patch20: powerd-%{PDVER}.dif Patch21: powerd-%{PDVER}-getaddrinfo.patch Patch30: killproc-%{KPVER}.dif @@ -71,6 +74,7 @@ %package tools Summary: Tools for basic booting +Group: System/Base %if 0%{suse_version} > 1120 Requires(preun): coreutils %insserv_prereq Requires(postun): coreutils %insserv_prereq @@ -85,6 +89,7 @@ %package init Summary: Provides /sbin/init for sysvinit +Group: System/Base Provides: sbin_init Conflicts: otherproviders(sbin_init) Requires: %{name} @@ -103,6 +108,8 @@ %patch7 -p0 -b .crypt %patch8 -p0 -b .blowfish %patch9 -p0 -b .no-kill +%patch10 -p0 -b .env +%patch11 -p0 -b .dostat %patch pushd doc mkdir killproc powerd showconsole ++++++ sysvinit-2.88+dsf-dostat.patch ++++++ Index: src/killall5.c =================================================================== --- src/killall5.c (revision 114) +++ src/killall5.c (working copy) @@ -638,8 +638,32 @@ int readproc(int do_stat) if ((p->nfs = check4nfs(path, buf))) goto link; case DO_STAT: - if (stat(path, &st) != 0) + if (stat(path, &st) != 0) { + char * ptr; + + len = readlink(path, buf, PATH_MAX); + if (len <= 0) + break; + buf[len] = '\0'; + + ptr = strstr(buf, " (deleted)"); + if (!ptr) + break; + *ptr = '\0'; + len -= strlen(" (deleted)"); + + if (stat(buf, &st) != 0) + break; + p->dev = st.st_dev; + p->ino = st.st_ino; + p->pathname = (char *)xmalloc(len + 1); + memcpy(p->pathname, buf, len); + p->pathname[len] = '\0'; + + /* All done */ break; + } + p->dev = st.st_dev; p->ino = st.st_ino; ++++++ sysvinit-2.88+dsf-env.patch ++++++ Index: src/init.c =================================================================== --- src/init.c (revision 113) +++ src/init.c (working copy) @@ -248,7 +248,7 @@ void *imalloc(size_t size) } static -char *istrdup(char *s) +char *istrdup(const char *s) { char *m; int l; @@ -880,6 +880,27 @@ void initlog(int loglevel, char *s, ...) } } +/* + * Add or replace specific environment value + */ +int addnewenv(const char *new, char **curr, int n) +{ + size_t nlen = strcspn(new, "="); + int i; + for (i = 0; i < n; i++) { + if (nlen != strcspn(curr[i], "=")) + continue; + if (strncmp (new, curr[i], nlen) == 0) + break; + } + if (i >= n) + curr[n++] = istrdup(new); + else { + free(curr[i]); + curr[i] = istrdup(new); + } + return n; +} /* * Build a new environment for execve(). @@ -888,7 +909,7 @@ char **init_buildenv(int child) { char i_lvl[] = "RUNLEVEL=x"; char i_prev[] = "PREVLEVEL=x"; - char i_cons[32]; + char i_cons[128]; char i_shell[] = "SHELL=" SHELL; char **e; int n, i; @@ -898,25 +919,30 @@ char **init_buildenv(int child) n += NR_EXTRA_ENV; if (child) n += 8; - e = calloc(n, sizeof(char *)); + while ((e = (char**)calloc(n, sizeof(char *))) == NULL) { + initlog(L_VB, "out of memory"); + do_sleep(5); + } + for (n = 0; environ[n]; n++) e[n] = istrdup(environ[n]); for (i = 0; i < NR_EXTRA_ENV; i++) { - if (extra_env[i]) - e[n++] = istrdup(extra_env[i]); + if (extra_env[i] == NULL || *extra_env[i] == '\0') + continue; + n = addnewenv(extra_env[i], e, n); } if (child) { snprintf(i_cons, sizeof(i_cons), "CONSOLE=%s", console_dev); i_lvl[9] = thislevel; i_prev[10] = prevlevel; - e[n++] = istrdup(i_shell); - e[n++] = istrdup(i_lvl); - e[n++] = istrdup(i_prev); - e[n++] = istrdup(i_cons); - e[n++] = istrdup(E_VERSION); + n = addnewenv(i_shell, e, n); + n = addnewenv(i_lvl, e, n); + n = addnewenv(i_prev, e, n); + n = addnewenv(i_cons, e, n); + n = addnewenv(E_VERSION, e, n); } e[n++] = NULL; @@ -2133,41 +2159,46 @@ void fifo_new_level(int level) static void initcmd_setenv(char *data, int size) { - char *env, *p, *e, *eq; - int i, sz; + char *env, *p, *e; + size_t sz; + int i, eq; e = data + size; while (*data && data < e) { - eq = NULL; for (p = data; *p && p < e; p++) - if (*p == '=') eq = p; + ; if (*p) break; env = data; data = ++p; - sz = eq ? (eq - env) : (p - env); - - /*initlog(L_SY, "init_setenv: %s, %s, %d", env, eq, sz);*/ - /* * We only allow INIT_* to be set. */ if (strncmp(env, "INIT_", 5) != 0) continue; + sz = strcspn(env, "="); + eq = (env[sz] == '='); + + /*initlog(L_SY, "init_setenv: %s, %d, %d", env, eq, sz);*/ + /* Free existing vars. */ for (i = 0; i < NR_EXTRA_ENV; i++) { - if (extra_env[i] == NULL) continue; - if (!strncmp(extra_env[i], env, sz) && - extra_env[i][sz] == '=') { + if (extra_env[i] == NULL) + continue; + if (sz != strcspn(extra_env[i], "=")) + continue; + if (strncmp(extra_env[i], env, sz) == 0) { free(extra_env[i]); extra_env[i] = NULL; } } + if (eq == 0) + continue; + /* Set new vars if needed. */ - if (eq == NULL) continue; for (i = 0; i < NR_EXTRA_ENV; i++) { if (extra_env[i] == NULL) { extra_env[i] = istrdup(env); -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org