Dr. Werner Fink 2012-05-04 12:50:26 +00:00 committed by Git OBS Bridge
parent 9effcfe43c
commit 547bc97997
3 changed files with 23 additions and 15 deletions

View File

@ -1,8 +1,6 @@
Index: src/init.c
===================================================================
--- src/init.c (revision 113)
+++ src/init.c (working copy)
@@ -248,7 +248,7 @@ void *imalloc(size_t size)
--- src/init.c
+++ src/init.c 2012-05-04 13:56:17.470065199 +0200
@@ -252,7 +252,7 @@ void *imalloc(size_t size)
}
static
@ -11,7 +9,7 @@ Index: src/init.c
{
char *m;
int l;
@@ -880,6 +880,27 @@ void initlog(int loglevel, char *s, ...)
@@ -884,6 +884,27 @@ void initlog(int loglevel, char *s, ...)
}
}
@ -39,7 +37,7 @@ Index: src/init.c
/*
* Build a new environment for execve().
@@ -888,7 +909,7 @@ char **init_buildenv(int child)
@@ -892,35 +913,40 @@ char **init_buildenv(int child)
{
char i_lvl[] = "RUNLEVEL=x";
char i_prev[] = "PREVLEVEL=x";
@ -48,17 +46,20 @@ Index: src/init.c
char i_shell[] = "SHELL=" SHELL;
char **e;
int n, i;
@@ -898,25 +919,30 @@ char **init_buildenv(int child)
n += NR_EXTRA_ENV;
for (n = 0; environ[n]; n++)
;
- n += NR_EXTRA_ENV;
+ n += NR_EXTRA_ENV + 1; /* Also room for last NULL */
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]);
@ -87,7 +88,7 @@ Index: src/init.c
}
e[n++] = NULL;
@@ -2133,41 +2159,46 @@ void fifo_new_level(int level)
@@ -2146,41 +2172,46 @@ void fifo_new_level(int level)
static
void initcmd_setenv(char *data, int size)
{

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri May 4 12:47:47 UTC 2012 - werner@suse.de
- Add two patch from upstream
+ Avoid crash for exported environment for processes init spawns
- Fix typo as the script for powerd (bnc#758920)
-------------------------------------------------------------------
Mon Apr 16 08:18:25 UTC 2012 - mvyskocil@suse.cz

View File

@ -60,8 +60,8 @@ Patch21: powerd-%{PDVER}-getaddrinfo.patch
Patch30: killproc-%{KPVER}.dif
Patch40: showconsole-%{SCVER}.dif
Patch50: startpar-%{START}.dif
Requires: sysvinit-tools
Requires: mingetty
Requires: sysvinit-tools
%description
System V style init programs by Miquel van Smoorenburg that control the
@ -227,7 +227,7 @@ popd
chmod 444 ${RPM_BUILD_ROOT}%{_mandir}/man?/*
%preun tools
%stop_on_removal powered
%stop_on_removal powerd
%post
if test -x /sbin/telinit -a -p /dev/initctl -a -f /proc/1/exe -a -d /proc/1/root -a ! -d /.build -a -x /sbin/init; then
@ -244,7 +244,7 @@ if test -x /sbin/mkinitrd_setup; then
fi
%postun tools
%restart_on_update powered
%restart_on_update powerd
%insserv_cleanup
if test -x /sbin/mkinitrd_setup; then
mkinitrd_setup