1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 70_wall_ttyname.dpatch by Petter Reinholdtsen
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Use UT_LINESIZE from <utmp.h> instead of hardcoded string
6
## DP: lengths. Patch from SuSe.
9
Index: sysvinit/src/dowall.c
10
===================================================================
11
--- sysvinit/src/dowall.c (revisjon 64)
12
+++ sysvinit/src/dowall.c (arbeidskopi)
16
static char uidbuf[32];
17
- static char ttynm[32];
18
+ static char ttynm[UT_LINESIZE + 4];
23
utmp->ut_user[0] == 0) continue;
24
if (strncmp(utmp->ut_line, "/dev/", 5) == 0) {
26
- strncat(term, utmp->ut_line, UT_LINESIZE);
27
+ strncat(term, utmp->ut_line, sizeof(term)-1);
29
snprintf(term, sizeof(term), "/dev/%.*s",
30
UT_LINESIZE, utmp->ut_line);