Accepting request 58965 from Base:System

Accepted submit request 58965 from user WernerFink

OBS-URL: https://build.opensuse.org/request/show/58965
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysvinit?expand=0&rev=93
This commit is contained in:
Lars Vogdt 2011-01-24 15:24:04 +00:00 committed by Git OBS Bridge
commit 8f1fdcc629
2 changed files with 33 additions and 5 deletions

View File

@ -1,6 +1,29 @@
--- libinit.c --- libinit.c
+++ libinit.c 2010-10-27 08:17:06.371926813 +0000 +++ libinit.c 2011-01-21 18:25:49.019926024 +0000
@@ -728,19 +728,21 @@ int pidof (const char * inname, const ch @@ -307,15 +307,16 @@ static void init_mounts(void)
}
}
-static MNTINFO *find_mount(const char * path)
+static int find_mount(const char * path, MNTINFO *s)
{
- MNTINFO *m;
+ MNTINFO *m, *p = s->parent;
for (m = mounts; m; m = m->next) {
- if (strncmp(path, m->point, m->nlen))
- continue;
- break;
+ if (s == m && strncmp(path, m->point, m->nlen) == 0)
+ return 1;
+ if (p == m && strncmp(path, p->point, p->nlen) == 0)
+ return 1;
}
- return m;
+ return 0;
}
extern inline char * handl_buf(char *restrict buf)
@@ -728,19 +729,21 @@ int pidof (const char * inname, const ch
if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) { if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
char entry[PATH_MAX+1]; char entry[PATH_MAX+1];
char *realname = NULL; char *realname = NULL;
@ -26,13 +49,13 @@
- if (prefix && find_mount(name) != prefix) - if (prefix && find_mount(name) != prefix)
- continue; - continue;
+ if (find_mount(name) != prefix) + if (!find_mount(name, prefix))
+ continue; + continue;
+ } + }
if (fstatat(dfd, here(d->d_name, "exe"), &pid_st, 0) < 0) { if (fstatat(dfd, here(d->d_name, "exe"), &pid_st, 0) < 0) {
if (errno != EPERM && errno != EACCES) if (errno != EPERM && errno != EACCES)
@@ -765,12 +767,22 @@ int pidof (const char * inname, const ch @@ -765,12 +768,22 @@ int pidof (const char * inname, const ch
if (strlen(fullname) > PATH_MAX) if (strlen(fullname) > PATH_MAX)
continue; continue;

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jan 21 19:26:44 CET 2011 - werner@suse.de
- Killproc: Do not be fooled if a device is mounted several times
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Nov 9 16:30:56 CET 2010 - werner@suse.de Tue Nov 9 16:30:56 CET 2010 - werner@suse.de
@ -16,7 +21,7 @@ Wed Oct 27 12:46:16 CEST 2010 - werner@suse.de
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Oct 21 12:00:26 CEST 2010 - werner@suse.de Thu Oct 21 12:00:26 CEST 2010 - werner@suse.de
- New killporc version 2.17 - New killproc version 2.17
* Use /proc/self/mountinfo to avoid system call stat(2) on * Use /proc/self/mountinfo to avoid system call stat(2) on
running binaries not located on the mount point of the running binaries not located on the mount point of the
current handled program current handled program