OBS User unknown 2009-03-11 20:39:53 +00:00 committed by Git OBS Bridge
parent 9d43165817
commit 3ace9e3883
4 changed files with 73 additions and 18 deletions

32
killproc-2.14.dif Normal file
View File

@ -0,0 +1,32 @@
--- libinit.h
+++ libinit.h 2009-03-10 13:06:32.512001779 +0100
@@ -46,7 +46,7 @@
# define restrict __restrict__
# endif
#endif
-#define alignof(type) (sizeof(type)+(sizeof(type)%sizeof(void*)))
+#define alignof(type) ((sizeof(type)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))
/*
* LSB specs:
--- mkill.c
+++ mkill.c 2009-03-11 14:37:13.668001801 +0100
@@ -525,6 +525,7 @@ static void sort_proc(void)
static int check(const char *restrict name)
{
+ const size_t nlen = strlen(name);
mntent_t *p, *n, *l;
n = mntent;
@@ -532,6 +533,10 @@ static int check(const char *restrict na
for (p = mntent; n; p = n) {
l = p->prev;
n = p->next;
+ if (nlen < p->nlen)
+ continue;
+ if (name[p->nlen] != '\0' && name[p->nlen] != '/')
+ continue;
if (strncmp(name, p->name, p->nlen) == 0)
return p->order;
}

View File

@ -1,5 +1,5 @@
--- src/killall5.c --- src/killall5.c
+++ src/killall5.c 2008-10-01 16:42:51.186708662 +0200 +++ src/killall5.c 2009-03-11 14:13:21.708001809 +0100
@@ -40,6 +40,8 @@ @@ -40,6 +40,8 @@
#include <syslog.h> #include <syslog.h>
#include <getopt.h> #include <getopt.h>
@ -40,7 +40,7 @@
/* Did we stop all processes ? */ /* Did we stop all processes ? */
int sent_sigstop; int sent_sigstop;
@@ -152,6 +166,111 @@ int mount_proc(void) @@ -152,6 +166,116 @@ int mount_proc(void)
return did_mount; return did_mount;
} }
@ -135,12 +135,17 @@
+ if (real) strcpy(real, curr); + if (real) strcpy(real, curr);
+ +
+ if (errno == EINVAL) { + if (errno == EINVAL) {
+ const size_t nlen = strlen(curr);
+ NFS *p, *n, *l; + NFS *p, *n, *l;
+ n = nlist; + n = nlist;
+ l = (NFS*)0; + l = (NFS*)0;
+ for (p = nlist; n; p = n) { + for (p = nlist; n; p = n) {
+ l = p->prev; + l = p->prev;
+ n = p->next; + n = p->next;
+ if (nlen < p->nlen)
+ continue;
+ if (curr[p->nlen] != '\0' && curr[p->nlen] != '/')
+ continue;
+ if (!strncmp(curr, p->name, p->nlen)) + if (!strncmp(curr, p->name, p->nlen))
+ return 1; + return 1;
+ } + }
@ -152,7 +157,7 @@
int readarg(FILE *fp, char *buf, int sz) int readarg(FILE *fp, char *buf, int sz)
{ {
int c = 0, f = 0; int c = 0, f = 0;
@@ -173,8 +292,8 @@ int readproc() @@ -173,8 +297,8 @@ int readproc()
PROC *p, *n; PROC *p, *n;
struct dirent *d; struct dirent *d;
struct stat st; struct stat st;
@ -163,7 +168,7 @@
char *s, *q; char *s, *q;
unsigned long startcode, endcode; unsigned long startcode, endcode;
int pid, f; int pid, f;
@@ -191,6 +310,7 @@ int readproc() @@ -191,6 +315,7 @@ int readproc()
n = p->next; n = p->next;
if (p->argv0) free(p->argv0); if (p->argv0) free(p->argv0);
if (p->argv1) free(p->argv1); if (p->argv1) free(p->argv1);
@ -171,7 +176,7 @@
free(p); free(p);
} }
plist = NULL; plist = NULL;
@@ -225,6 +345,9 @@ int readproc() @@ -225,6 +350,9 @@ int readproc()
nsyslog(LOG_ERR, nsyslog(LOG_ERR,
"can't get program name from %s\n", "can't get program name from %s\n",
path); path);
@ -181,7 +186,7 @@
free(p); free(p);
continue; continue;
} }
@@ -248,6 +371,9 @@ int readproc() @@ -248,6 +376,9 @@ int readproc()
p->sid = 0; p->sid = 0;
nsyslog(LOG_ERR, "can't read sid from %s\n", nsyslog(LOG_ERR, "can't read sid from %s\n",
path); path);
@ -191,7 +196,7 @@
free(p); free(p);
continue; continue;
} }
@@ -256,6 +382,9 @@ int readproc() @@ -256,6 +387,9 @@ int readproc()
fclose(fp); fclose(fp);
} else { } else {
/* Process disappeared.. */ /* Process disappeared.. */
@ -201,7 +206,7 @@
free(p); free(p);
continue; continue;
} }
@@ -300,13 +429,18 @@ int readproc() @@ -300,13 +434,18 @@ int readproc()
} else { } else {
/* Process disappeared.. */ /* Process disappeared.. */
@ -221,7 +226,7 @@
p->dev = st.st_dev; p->dev = st.st_dev;
p->ino = st.st_ino; p->ino = st.st_ino;
} }
@@ -374,12 +508,25 @@ PIDQ_HEAD *pidof(char *prog) @@ -374,12 +513,25 @@ PIDQ_HEAD *pidof(char *prog)
PIDQ_HEAD *q; PIDQ_HEAD *q;
struct stat st; struct stat st;
char *s; char *s;
@ -248,7 +253,7 @@
/* Get basename of program. */ /* Get basename of program. */
if ((s = strrchr(prog, '/')) == NULL) if ((s = strrchr(prog, '/')) == NULL)
@@ -393,10 +540,30 @@ PIDQ_HEAD *pidof(char *prog) @@ -393,10 +545,30 @@ PIDQ_HEAD *pidof(char *prog)
/* First try to find a match based on dev/ino pair. */ /* First try to find a match based on dev/ino pair. */
if (dostat) { if (dostat) {
for (p = plist; p; p = p->next) { for (p = plist; p; p = p->next) {
@ -283,7 +288,7 @@
} }
} }
@@ -428,7 +595,7 @@ PIDQ_HEAD *pidof(char *prog) @@ -428,7 +600,7 @@ PIDQ_HEAD *pidof(char *prog)
if (ok) add_pid_to_q(q, p); if (ok) add_pid_to_q(q, p);
} }
@ -292,7 +297,7 @@
} }
/* Give usage message and exit. */ /* Give usage message and exit. */
@@ -477,6 +644,9 @@ int main_pidof(int argc, char **argv) @@ -477,6 +649,9 @@ int main_pidof(int argc, char **argv)
int first = 1; int first = 1;
int i, oind, opt, flags = 0; int i, oind, opt, flags = 0;
@ -302,7 +307,7 @@
for (oind = PIDOF_OMITSZ-1; oind > 0; oind--) for (oind = PIDOF_OMITSZ-1; oind > 0; oind--)
opid[oind] = 0; opid[oind] = 0;
opterr = 0; opterr = 0;
@@ -561,6 +731,7 @@ int main(int argc, char **argv) @@ -561,6 +736,7 @@ int main(int argc, char **argv)
PROC *p; PROC *p;
int pid, sid = -1; int pid, sid = -1;
int sig = SIGKILL; int sig = SIGKILL;
@ -310,7 +315,7 @@
/* Get program name. */ /* Get program name. */
if ((progname = strrchr(argv[0], '/')) == NULL) if ((progname = strrchr(argv[0], '/')) == NULL)
@@ -583,7 +754,10 @@ int main(int argc, char **argv) @@ -583,7 +759,10 @@ int main(int argc, char **argv)
} }
/* First get the /proc filesystem online. */ /* First get the /proc filesystem online. */
@ -322,7 +327,7 @@
/* /*
* Ignoring SIGKILL and SIGSTOP do not make sense, but * Ignoring SIGKILL and SIGSTOP do not make sense, but
@@ -608,9 +782,13 @@ int main(int argc, char **argv) @@ -608,9 +787,13 @@ int main(int argc, char **argv)
/* Now kill all processes except our session. */ /* Now kill all processes except our session. */
sid = (int)getsid(0); sid = (int)getsid(0);
pid = (int)getpid(); pid = (int)getpid();

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Wed Mar 11 14:24:06 CET 2009 - werner@suse.de
- nfs4pidof: make sure not to stumble on short named mount points
to avoid to terminate processes on wrong mount points
-------------------------------------------------------------------
Tue Mar 10 13:12:16 CET 2009 - werner@suse.de
- mkill: make sure not to stumble on short named mount points to
avoid to terminate processes on wrong mount points (bnc#466484)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Mar 9 13:54:55 CET 2009 - werner@suse.de Mon Mar 9 13:54:55 CET 2009 - werner@suse.de

View File

@ -30,7 +30,7 @@ Group: System/Base
PreReq: coreutils PreReq: coreutils
AutoReqProv: on AutoReqProv: on
Version: 2.86 Version: 2.86
Release: 198 Release: 199
Summary: SysV-Style init Summary: SysV-Style init
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libselinux-devel libsepol-devel BuildRequires: libselinux-devel libsepol-devel
@ -47,7 +47,7 @@ Source10: mkinitrd-kill2.sh
Patch: sysvinit-2.86.dif Patch: sysvinit-2.86.dif
Patch1: sysvinit-2.86-nfs4pidof.patch Patch1: sysvinit-2.86-nfs4pidof.patch
Patch2: powerd-2.0.2.dif Patch2: powerd-2.0.2.dif
#Patch3: killproc-2.14.dif Patch3: killproc-2.14.dif
Patch5: sysvinit-2.86-sulogin.patch Patch5: sysvinit-2.86-sulogin.patch
Patch6: sysvinit-2.82-startstop.patch Patch6: sysvinit-2.82-startstop.patch
Patch7: sysvinit-2.85-suse.patch Patch7: sysvinit-2.85-suse.patch
@ -103,7 +103,7 @@ pushd ../powerd-%{PDVER}
%patch -P 2 %patch -P 2
popd popd
pushd ../killproc-%{KPVER} pushd ../killproc-%{KPVER}
#%patch -P 3 %patch -P 3
popd popd
pushd ../showconsole-%{SCVER} pushd ../showconsole-%{SCVER}
%patch -P 10 %patch -P 10
@ -323,6 +323,12 @@ rm -rf ${RPM_BUILD_ROOT}
%doc %{_mandir}/man8/mkill.8.gz %doc %{_mandir}/man8/mkill.8.gz
%changelog %changelog
* Wed Mar 11 2009 werner@suse.de
- nfs4pidof: make sure not to stumble on short named mount points
to avoid to terminate processes on wrong mount points
* Tue Mar 10 2009 werner@suse.de
- mkill: make sure not to stumble on short named mount points to
avoid to terminate processes on wrong mount points (bnc#466484)
* Mon Mar 09 2009 werner@suse.de * Mon Mar 09 2009 werner@suse.de
- Add patch from Debian people to startpar and mode to version 0.53 - Add patch from Debian people to startpar and mode to version 0.53
* Thu Mar 05 2009 werner@suse.de * Thu Mar 05 2009 werner@suse.de