Accepting request 51454 from Base:System

Accepted submit request 51454 from user WernerFink

OBS-URL: https://build.opensuse.org/request/show/51454
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysvinit?expand=0&rev=87
This commit is contained in:
Ruediger Oertel 2010-10-28 11:24:33 +00:00 committed by Git OBS Bridge
commit 8d91da4715
2 changed files with 63 additions and 4 deletions

View File

@ -1,4 +1,58 @@
--- .dummy
+++ .dummy 2010-10-21 09:54:54.587926689 +0000
@@ -0,0 +1 @@
+Just a dummy, remove for a real patch
--- libinit.c
+++ libinit.c 2010-10-27 08:17:06.371926813 +0000
@@ -728,19 +728,21 @@ int pidof (const char * inname, const ch
if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
char entry[PATH_MAX+1];
char *realname = NULL;
- const char *name;
+ const char *name = NULL;
boolean found;
- if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
- if (errno != EPERM && errno != EACCES)
- goto risky;
- continue;
- }
- entry[rll] = '\0';
- name = handl_buf(entry);
+ if (prefix) {
+ if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
+ if (errno != EPERM && errno != EACCES)
+ goto risky;
+ continue;
+ }
+ entry[rll] = '\0';
+ name = handl_buf(entry);
- if (prefix && find_mount(name) != prefix)
- continue;
+ if (find_mount(name) != prefix)
+ continue;
+ }
if (fstatat(dfd, here(d->d_name, "exe"), &pid_st, 0) < 0) {
if (errno != EPERM && errno != EACCES)
@@ -765,12 +767,22 @@ int pidof (const char * inname, const ch
if (strlen(fullname) > PATH_MAX)
continue;
+ if (!name) {
+ if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
+ if (errno != EPERM && errno != EACCES)
+ goto risky;
+ continue;
+ }
+ entry[rll] = '\0';
+ name = handl_buf(entry);
+ }
+
if (strncmp(fullname, name, PATH_MAX) == 0) {
found = true;
break;
}
- if ((realname = realpath(name, NULL)) == (char*)0)
+ if ((realname = realpath(fullname, NULL)) == (char*)0)
continue;
if (strncmp(realname, name, PATH_MAX) == 0)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Oct 27 12:46:16 CEST 2010 - werner@suse.de
- Fix cast&past error in killproc/checkproc
-------------------------------------------------------------------
Thu Oct 21 12:00:26 CEST 2010 - werner@suse.de