[sysvinit] deal with disappearing files and binaries with a newline in their name (#853081)

Lukáš Nykrýn lnykryn at fedoraproject.org
Fri Jun 21 15:00:26 UTC 2013


commit 0ac5d50b3d674e49fa0e6abcdbb1330b994694fa
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Fri Jun 21 16:58:40 2013 +0200

    deal with disappearing files and binaries with a newline in their name (#853081)

 sysvinit-2.88-newline.patch |   28 ++++++++++++++++++++++++++++
 sysvinit.spec               |    8 +++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/sysvinit-2.88-newline.patch b/sysvinit-2.88-newline.patch
new file mode 100644
index 0000000..8275823
--- /dev/null
+++ b/sysvinit-2.88-newline.patch
@@ -0,0 +1,28 @@
+diff --git a/src/killall5.c b/src/killall5.c
+index e73885e..c0723b8 100644
+--- a/src/killall5.c
++++ b/src/killall5.c
+@@ -475,6 +475,7 @@ int readproc(int do_stat)
+ 	char		*s, *q;
+ 	unsigned long	startcode, endcode;
+ 	int		pid, f;
++	int		i, c;
+ 
+ 	/* Open the /proc directory. */
+ 	if (chdir("/proc") == -1) {
+@@ -512,8 +513,13 @@ int readproc(int do_stat)
+ 
+ 		/* Read SID & statname from it. */
+ 		if ((fp = fopen(path, "r")) != NULL) {
+-			buf[0] = 0;
+-			fgets(buf, sizeof(buf), fp);
++                        for (i = 0; i<PATH_MAX && (c=fgetc(fp))!=EOF; i++)
++                                buf[i]=c;
++
++                        if (i == 0)
++                                continue;
++
++                        buf[i] = 0;
+ 
+ 			/* See if name starts with '(' */
+ 			s = buf;
diff --git a/sysvinit.spec b/sysvinit.spec
index 3d782d4..514e292 100644
--- a/sysvinit.spec
+++ b/sysvinit.spec
@@ -1,7 +1,7 @@
 Summary: Programs which control basic system processes
 Name: sysvinit
 Version: 2.88
-Release: 10.dsf%{?dist}
+Release: 11.dsf%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-%{version}dsf.tar.bz2
@@ -16,6 +16,7 @@ Patch14: sysvinit-2.88-ipv6.patch
 Patch15: sysvinit-2.88-omit.patch
 Patch16: sysvinit-2.88-wall-maxlines.patch
 Patch17: sysvinit-2.88-wall-broadcast-message.patch
+Patch18: sysvinit-2.88-newline.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: pam >= 0.66-5
 Requires: filesystem >= 2.2.4-1
@@ -63,6 +64,8 @@ management.
 %patch16 -p1 -b .maxlines
 # Raise limit for broadcast message
 %patch17 -p1 -b .broadcast
+# Deal with disappearing files and binaries with a newline in their name (#853081)
+%patch18 -p1 -b .newline
 
 %build
 %ifarch sparcv9 sparc64 s390 s390x
@@ -154,6 +157,9 @@ rm -rf $RPM_BUILD_ROOT
 #%{_mandir}/man8/sulogin*
 
 %changelog
+* Fri Jun 21 2013 Lukáš Nykrýn <lnykryn at redhat.com> - 2.88-11.dsf
+- Deal with disappearing files and binaries with a newline in their name (#853081)
+
 * Fri Feb 15 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.88-10.dsf
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list