1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 71_wall_hostname.dpatch by Petter Reinholdtsen
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Include hostname in output from halt. Closes debian bug
9
Index: sysvinit/src/dowall.c
10
===================================================================
11
--- sysvinit/src/dowall.c (revisjon 100)
12
+++ sysvinit/src/dowall.c (arbeidskopi)
15
char term[UT_LINESIZE+6];
17
+ char hostname[256]; /* HOST_NAME_MAX+1 */
23
getuidtty(&user, &tty);
25
+ /* Get and report current hostname, to make it easier to find
26
+ out which machine is being shut down. */
27
+ if (0 != gethostname(hostname, sizeof(hostname))) {
28
+ strncpy(hostname, "[unknown]", sizeof(hostname)-1);
30
+ /* If hostname is truncated, it is unspecified if the string
31
+ is null terminated or not. Make sure we know it is null
33
+ hostname[sizeof(hostname)-1] = 0;
41
snprintf(line, sizeof(line),
42
- "\007\r\nBroadcast message from %s %s(%s):\r\n\r\n",
44
+ "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
45
+ user, hostname, tty, date);