diff --git a/showconsole-1.15.dif b/showconsole-1.15.dif new file mode 100644 index 0000000..6e3c772 --- /dev/null +++ b/showconsole-1.15.dif @@ -0,0 +1,10 @@ +--- showconsole.8 ++++ showconsole.8 2011-09-08 15:13:48.000000000 +0000 +@@ -8,7 +8,6 @@ + .\" + .TH SHOWCONSOLE 8 "Nov 10, 2000" "Version 1.16" "The SuSE boot concept" + .UC 8 +-.OS SuSE Linux + .SH NAME + Showconsole \- determines the real tty of stdin + .br diff --git a/showconsole-1.15.tar.bz2 b/showconsole-1.15.tar.bz2 new file mode 100644 index 0000000..1d57ff2 --- /dev/null +++ b/showconsole-1.15.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24074b56e133f3136b9654a6e5950d8582b9e6cf7c4e8af5bf4cc09728db6028 +size 25634 diff --git a/showconsole-1.16.dif b/showconsole-1.16.dif deleted file mode 100644 index ca5403c..0000000 --- a/showconsole-1.16.dif +++ /dev/null @@ -1,4 +0,0 @@ ---- .#nothing -+++ .#nothing 2011-09-01 11:59:52.000000000 +0000 -@@ -0,0 +1 @@ -+Please remove if patched diff --git a/showconsole-1.16.tar.gz b/showconsole-1.16.tar.gz deleted file mode 100644 index e19b6bd..0000000 --- a/showconsole-1.16.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fdd26fc738b8d7e7002a4ad2c7247202ef7993aff8db82df39f88f0ce134459e -size 30243 diff --git a/sysvinit-2.88dsf-no-kill.patch b/sysvinit-2.88dsf-no-kill.patch index 0bbfcae..848669d 100644 --- a/sysvinit-2.88dsf-no-kill.patch +++ b/sysvinit-2.88dsf-no-kill.patch @@ -1,6 +1,6 @@ --- src/killall5.c -+++ src/killall5.c 2010-03-19 14:29:44.000000000 +0000 -@@ -444,6 +444,38 @@ int readarg(FILE *fp, char *buf, int sz) ++++ src/killall5.c 2011-10-17 12:11:32.000000000 +0000 +@@ -454,6 +454,38 @@ int readarg(FILE *fp, char *buf, int sz) } /* @@ -39,15 +39,7 @@ * Read the proc filesystem. * CWD must be /proc to avoid problems if / is affected by the killing (ie depend on fuse). */ -@@ -458,6 +490,7 @@ int readproc(int do_stat) - char buf[PATH_MAX+1]; - char *s, *q; - unsigned long startcode, endcode; -+ ssize_t len; - int pid, f; - - /* Open the /proc directory. */ -@@ -608,6 +641,26 @@ int readproc(int do_stat) +@@ -634,6 +666,26 @@ int readproc(int do_stat) p->nfs = 0; switch (do_stat) { @@ -73,4 +65,4 @@ + break; case DO_NETFS: if ((p->nfs = check4nfs(path, buf))) - break; + goto link; diff --git a/sysvinit-2.88dsf-scripts2.patch b/sysvinit-2.88dsf-scripts2.patch new file mode 100644 index 0000000..e5e4352 --- /dev/null +++ b/sysvinit-2.88dsf-scripts2.patch @@ -0,0 +1,106 @@ +--- src/killall5.c ++++ src/killall5.c 2011-10-17 12:18:06.455147132 +0000 +@@ -469,6 +469,7 @@ int readproc(int do_stat) + char *s, *q; + unsigned long startcode, endcode; + int pid, f; ++ ssize_t len; + + /* Open the /proc directory. */ + if (chdir("/proc") == -1) { +@@ -635,23 +636,22 @@ int readproc(int do_stat) + switch (do_stat) { + case DO_NETFS: + if ((p->nfs = check4nfs(path, buf))) +- break; ++ goto link; + case DO_STAT: + if (stat(path, &st) != 0) + break; +- else { +- char buf[PATH_MAX]; +- +- f = readlink(path, buf, sizeof buf); +- if (f > 0) { +- p->pathname = (char *)xmalloc(f + 1); +- memcpy(p->pathname, buf, f); +- p->pathname[f] = '\0'; +- } +- } + p->dev = st.st_dev; + p->ino = st.st_ino; ++ ++ /* Fall through */ + default: ++ link: ++ len = readlink(path, buf, PATH_MAX); ++ if (len > 0) { ++ p->pathname = (char *)xmalloc(len + 1); ++ memcpy(p->pathname, buf, len); ++ p->pathname[len] = '\0'; ++ } + break; + } + +@@ -722,6 +722,7 @@ PIDQ_HEAD *pidof(char *prog) + int dostat = 0; + int foundone = 0; + int ok = 0; ++ const int root = (getuid() == 0); + char real[PATH_MAX+1]; + + if (! prog) +@@ -769,16 +770,11 @@ PIDQ_HEAD *pidof(char *prog) + * network FS located binaries */ + if (!foundone && nfs) { + for (p = plist; p; p = p->next) { +- char exe [PATH_MAX+1]; +- char path[PATH_MAX+1]; +- int len; ++ if (!p->pathname) ++ continue; + if (!p->nfs) + continue; +- snprintf(exe, sizeof(exe), "/proc/%d/exe", p->pid); +- if ((len = readlink(exe, path, PATH_MAX)) < 0) +- continue; +- path[len] = '\0'; +- if (strcmp(prog, path) != 0) ++ if (strcmp(prog, p->pathname) != 0) + continue; + add_pid_to_q(q, p); + foundone++; +@@ -788,19 +784,31 @@ PIDQ_HEAD *pidof(char *prog) + /* If we didn't find a match based on dev/ino, try the name. */ + if (!foundone) for (p = plist; p; p = p->next) { + if (prog[0] == '/') { +- if (!p->pathname) +- continue; ++ if (!p->pathname) { ++ if (root) ++ continue; ++ goto fallback; ++ } + if (strcmp(prog, p->pathname)) { + int len = strlen(prog); + if (strncmp(prog, p->pathname, len)) ++ { ++ if (scripts_too) ++ goto fallback; + continue; ++ } + if (strcmp(" (deleted)", p->pathname + len)) ++ { ++ if (scripts_too) ++ goto fallback; + continue; ++ } + } + add_pid_to_q(q, p); + continue; + } + ++ fallback: + ok = 0; + + /* matching nonmatching diff --git a/sysvinit.changes b/sysvinit.changes index a493374..24a0522 100644 --- a/sysvinit.changes +++ b/sysvinit.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Oct 17 09:08:36 UTC 2011 - werner@suse.de + +- There was never a version 1.16 for showconsole +- Add some code to be able to detect programs even as user with + kernel 3.0 and above (bnc#723072) + ------------------------------------------------------------------- Tue Oct 11 13:46:46 UTC 2011 - coolo@suse.com diff --git a/sysvinit.spec b/sysvinit.spec index 44426fc..fbe4cc8 100644 --- a/sysvinit.spec +++ b/sysvinit.spec @@ -22,7 +22,7 @@ Name: sysvinit %define MGVER 0.9.6s %define PDVER 2.0.2 %define KPVER 2.20 -%define SCVER 1.16 +%define SCVER 1.15 %define SIVER 2.88+ %define START 0.57 License: GPLv2+ @@ -36,7 +36,7 @@ Url: http://savannah.nongnu.org/projects/sysvinit/ Source: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-%{SIVER}dsf.tar.bz2 Source2: killproc-%{KPVER}.tar.bz2 Source3: powerd-%{PDVER}.tar.bz2 -Source4: showconsole-%{SCVER}.tar.gz +Source4: showconsole-%{SCVER}.tar.bz2 Source5: startpar-%{START}.tar.bz2 Source6: rc.powerd Source7: %{name}-rpmlintrc @@ -46,12 +46,13 @@ Source10: mkinitrd-kill2.sh Patch: %{name}-%{version}dsf.dif Patch1: %{name}-2.82-startstop.patch Patch2: %{name}-2.88dsf-suse.patch -Patch3: %{name}-2.88dsf-no-kill.patch +Patch3: %{name}-2.88dsf-scripts2.patch Patch4: notify-pam-dead.patch Patch5: %{name}-2.88dsf-multiple-sulogin.patch Patch6: %{name}-%{version}dsf-run.diff Patch7: %{name}-%{version}dsf-crypt.patch Patch8: %{name}-%{version}dsf-blowfish.dif +Patch9: %{name}-2.88dsf-no-kill.patch Patch20: powerd-%{PDVER}.dif Patch21: powerd-%{PDVER}-getaddrinfo.patch Patch30: killproc-%{KPVER}.dif @@ -96,12 +97,13 @@ Just some symlinks %setup -n %{name}-%{SIVER}dsf -q -b 2 -b 3 -b 4 -b 5 %patch1 -p0 -b .startstop %patch2 -p0 -b .suse -%patch3 -p0 -b .no-kill +%patch3 -p0 -b .scripts2 %patch4 -p0 -b .pam %patch5 -p0 -b .sulogin %patch6 -p0 -b .run %patch7 -p0 -b .crypt %patch8 -p0 -b .blowfish +%patch9 -p0 -b .no-kill %patch pushd doc mkdir killproc powerd showconsole