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

Petter Reinholdtsen pere at costa.debian.org
Sat Nov 12 11:32:26 UTC 2005


Author: pere
Date: 2005-11-12 11:32:25 +0000 (Sat, 12 Nov 2005)
New Revision: 109

Added:
   sysvinit/trunk/debian/patches/71_wall_hostname.dpatch
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/patches/00list
Log:
  * Added 71_wall_hostname.dpatch to include hostname in wall message
    from halt.  (Closes: #325772)

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2005-11-12 11:20:54 UTC (rev 108)
+++ sysvinit/trunk/debian/changelog	2005-11-12 11:32:25 UTC (rev 109)
@@ -15,6 +15,8 @@
   * Added 90_shutdown_H.dpatch to make sure shutdown flags -P and -H
     require the -h flag, and document this in the manual page.
     (Closes: #331041)
+  * Added 71_wall_hostname.dpatch to include hostname in wall message
+    from halt.  (Closes: #325772)
 
  -- Petter Reinholdtsen <pere at debian.org>  Sat,  8 Oct 2005 17:08:47 +0200
 

Modified: sysvinit/trunk/debian/patches/00list
===================================================================
--- sysvinit/trunk/debian/patches/00list	2005-11-12 11:20:54 UTC (rev 108)
+++ sysvinit/trunk/debian/patches/00list	2005-11-12 11:32:25 UTC (rev 109)
@@ -13,6 +13,7 @@
 60_init_race
 61_init_msg
 70_wall_ttyname
+71_wall_hostname
 80_killall_sched
 81_killall_avoid_init
 90_shutdown_H

Added: sysvinit/trunk/debian/patches/71_wall_hostname.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/71_wall_hostname.dpatch	2005-11-12 11:20:54 UTC (rev 108)
+++ sysvinit/trunk/debian/patches/71_wall_hostname.dpatch	2005-11-12 11:32:25 UTC (rev 109)
@@ -0,0 +1,48 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 71_wall_hostname.dpatch by Petter Reinholdtsen
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Include hostname in output from halt.  Closes debian bug
+## DP: #325772.
+
+ at DPATCH@
+Index: sysvinit/src/dowall.c
+===================================================================
+--- sysvinit/src/dowall.c	(revisjon 100)
++++ sysvinit/src/dowall.c	(arbeidskopi)
+@@ -131,6 +131,7 @@
+ 	time_t			t;
+ 	char			term[UT_LINESIZE+6];
+ 	char			line[81];
++	char                    hostname[256]; /* HOST_NAME_MAX+1 */
+ 	char			*date, *p;
+ 	char			*user, *tty;
+ 	int			fd, flags;
+@@ -144,6 +145,16 @@
+ 
+ 	getuidtty(&user, &tty);
+ 
++	/* Get and report current hostname, to make it easier to find
++	   out which machine is being shut down. */
++	if (0 != gethostname(hostname, sizeof(hostname))) {
++		strncpy(hostname, "[unknown]", sizeof(hostname)-1);
++	}
++	/* If hostname is truncated, it is unspecified if the string
++	   is null terminated or not.  Make sure we know it is null
++	   terminated. */
++	hostname[sizeof(hostname)-1] = 0;
++
+ 	/* Get the time */
+ 	time(&t);
+ 	date = ctime(&t);
+@@ -157,8 +168,8 @@
+ 			date);
+ 	} else {
+ 		snprintf(line, sizeof(line),
+-			"\007\r\nBroadcast message from %s %s(%s):\r\n\r\n",
+-			user, tty, date);
++			"\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
++			user, hostname, tty, date);
+ 	}
+ 
+ 	/*


Property changes on: sysvinit/trunk/debian/patches/71_wall_hostname.dpatch
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-sysvinit-commits mailing list