[Pkg-sysvinit-commits] r1375 - in sysvinit/trunk/debian: . patches

Petter Reinholdtsen pere at alioth.debian.org
Mon Jul 6 22:03:20 UTC 2009


Author: pere
Date: 2009-07-06 22:03:19 +0000 (Mon, 06 Jul 2009)
New Revision: 1375

Added:
   sysvinit/trunk/debian/patches/42_utmpdump_retval.dpatch
   sysvinit/trunk/debian/patches/46_pidof_symlinkman.dpatch
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/patches/00list
Log:
* New patch 42_utmpdump_retval fixing unchecked return value from
  malloc().  Patch from Christian 'Dr. Disk' Hechelmann and Fedora.
* New patch 46_pidof_symlinkman to improve pidof manual page regarding
  its handling of symlinks.  Patch from Bill Nottingham and Fedora.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2009-07-06 17:15:07 UTC (rev 1374)
+++ sysvinit/trunk/debian/changelog	2009-07-06 22:03:19 UTC (rev 1375)
@@ -18,6 +18,10 @@
     Patch from Goswin von Brederlow, fixing part of 476698.  The rest
     of the issues reported in #476698 should be handled using omitpids
     (Closes: #476698).
+  * New patch 42_utmpdump_retval fixing unchecked return value from
+    malloc().  Patch from Christian 'Dr. Disk' Hechelmann and Fedora.
+  * New patch 46_pidof_symlinkman to improve pidof manual page regarding
+    its handling of symlinks.  Patch from Bill Nottingham and Fedora.
 
  -- Petter Reinholdtsen <pere at debian.org>  Wed, 01 Jul 2009 20:04:20 +0200
 

Modified: sysvinit/trunk/debian/patches/00list
===================================================================
--- sysvinit/trunk/debian/patches/00list	2009-07-06 17:15:07 UTC (rev 1374)
+++ sysvinit/trunk/debian/patches/00list	2009-07-06 22:03:19 UTC (rev 1375)
@@ -14,7 +14,9 @@
 31_build_warnings
 40_selinux
 41_utmp_64bit
+42_utmpdump_retval
 45_pidof_symlink
+46_pidof_symlinkman
 50_bootlogd_exitcode
 51_bootlogd_syncalot
 52_bootlogd_createlogfile

Added: sysvinit/trunk/debian/patches/42_utmpdump_retval.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/42_utmpdump_retval.dpatch	                        (rev 0)
+++ sysvinit/trunk/debian/patches/42_utmpdump_retval.dpatch	2009-07-06 22:03:19 UTC (rev 1375)
@@ -0,0 +1,35 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+# 42_utmpdump_retval.dpatch by Christian 'Dr. Disk' Hechelmann and Fedora.
+
+Avoid issue with unchecked return value from malloc(), as reported to
+<URL:https://bugzilla.redhat.com/show_bug.cgi?id=473485>
+
+ at DPATCH@
+diff -ru sysvinit-2.86/src/utmpdump.c sysvinit-2.86.foo/src/utmpdump.c
+--- sysvinit-2.86/src/utmpdump.c	2000-09-12 16:14:24.000000000 -0500
++++ sysvinit-2.86.foo/src/utmpdump.c	2008-12-08 15:37:51.000000000 -0500
+@@ -81,18 +81,20 @@
+ time_t
+ strtotime(const char *s_time)
+ {
+-	struct tm *tm = malloc(sizeof(*tm));
++	struct tm tm;
++	
++	memset(&tm, '\0', sizeof(struct tm));
+ 
+ 	if (s_time[0] == ' ' || s_time[0] == '\0')
+ 		return (time_t)0;
+ 
+-	strptime(s_time, "%a %b %d %T %Y", tm);
++	strptime(s_time, "%a %b %d %T %Y", &tm);
+ 
+ 	/* Cheesy way of checking for DST */
+ 	if (s_time[26] == 'D')
+-		tm->tm_isdst = 1;
++		tm.tm_isdst = 1;
+ 
+-	return mktime(tm);
++	return mktime(&tm);
+ }
+ 
+ #define cleanse(x) xcleanse(x, sizeof(x))


Property changes on: sysvinit/trunk/debian/patches/42_utmpdump_retval.dpatch
___________________________________________________________________
Added: svn:executable
   + *

Added: sysvinit/trunk/debian/patches/46_pidof_symlinkman.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/46_pidof_symlinkman.dpatch	                        (rev 0)
+++ sysvinit/trunk/debian/patches/46_pidof_symlinkman.dpatch	2009-07-06 22:03:19 UTC (rev 1375)
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 46_pidof_symlinkman.dpatch by Bill Nottingham and Fedora.
+
+Document how pidof handle symlinks.
+
+ at DPATCH@
+diff -up sysvinit-2.86/man/pidof.8.foo sysvinit-2.86/man/pidof.8
+--- sysvinit-2.86/man/pidof.8.foo	2008-12-08 15:09:31.000000000 -0500
++++ sysvinit-2.86/man/pidof.8	2008-12-08 15:11:48.000000000 -0500
+@@ -43,7 +43,11 @@ which should also be located in \fP/sbin
+ When \fIpidof\fP is invoked with a full pathname to the program it
+ should find the pid of, it is reasonably safe. Otherwise it is possible
+ that it returns pids of running programs that happen to have the same name
+-as the program you're after but are actually other programs.
++as the program you're after but are actually other programs. Note that
++that the executable name of running processes is calculated with
++.BR readlink (2),
++so symbolic links to executables will also match.
++
+ .SH SEE ALSO
+ .BR shutdown (8),
+ .BR init (8),


Property changes on: sysvinit/trunk/debian/patches/46_pidof_symlinkman.dpatch
___________________________________________________________________
Added: svn:executable
   + *




More information about the Pkg-sysvinit-commits mailing list