[Pkg-sysvinit-commits] r1444 - in sysvinit-upstream/trunk: doc src

Petter Reinholdtsen pere at alioth.debian.org
Sun Jul 12 13:28:38 UTC 2009


Author: pere
Date: 2009-07-12 13:28:37 +0000 (Sun, 12 Jul 2009)
New Revision: 1444

Modified:
   sysvinit-upstream/trunk/doc/Changelog
   sysvinit-upstream/trunk/src/dowall.c
Log:
Modify wall to use UT_LINESIZE from <utmp.h> instead of hardcoded
string lengths.  Patch from SuSe.


Modified: sysvinit-upstream/trunk/doc/Changelog
===================================================================
--- sysvinit-upstream/trunk/doc/Changelog	2009-07-12 13:27:04 UTC (rev 1443)
+++ sysvinit-upstream/trunk/doc/Changelog	2009-07-12 13:28:37 UTC (rev 1444)
@@ -61,6 +61,8 @@
     Patch from Bill Nottingham and Fedora.
   * Modify init to shut down IDE, SCSI and SATA disks properly.  Patches
     from Sebastian Reichelt, Werner Fink and SuSe.
+  * Modify wall to use UT_LINESIZE from <utmp.h> instead of hardcoded
+    string lengths.  Patch from SuSe.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri, 30 Jul 2004 14:14:58 +0200
 

Modified: sysvinit-upstream/trunk/src/dowall.c
===================================================================
--- sysvinit-upstream/trunk/src/dowall.c	2009-07-12 13:27:04 UTC (rev 1443)
+++ sysvinit-upstream/trunk/src/dowall.c	2009-07-12 13:28:37 UTC (rev 1444)
@@ -65,7 +65,7 @@
 	uid_t			uid;
 	char			*tty;
 	static char		uidbuf[32];
-	static char		ttynm[32];
+	static char		ttynm[UT_LINESIZE + 4];
 	static int		init = 0;
 
 	if (!init) {
@@ -180,7 +180,7 @@
 		   utmp->ut_user[0] == 0) continue;
 		if (strncmp(utmp->ut_line, "/dev/", 5) == 0) {
 			term[0] = 0;
-			strncat(term, utmp->ut_line, UT_LINESIZE);
+			strncat(term, utmp->ut_line, sizeof(term)-1);
 		} else
 			snprintf(term, sizeof(term), "/dev/%.*s",
 				UT_LINESIZE, utmp->ut_line);




More information about the Pkg-sysvinit-commits mailing list