#! /bin/sh /usr/share/dpatch/dpatch-run ## 70_wall_ttyname.dpatch by Petter Reinholdtsen ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Use UT_LINESIZE from instead of hardcoded string ## DP: lengths. Patch from SuSe. @DPATCH@ Index: sysvinit/src/dowall.c =================================================================== --- sysvinit/src/dowall.c (revisjon 64) +++ sysvinit/src/dowall.c (arbeidskopi) @@ -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);