Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37885662
en ru br
Репозитории ALT
5.1: 2.86-alt2
4.1: 2.86-alt2
4.0: 2.86-alt1
3.0: 2.85-alt8
www.altlinux.org/Changes

Группа :: Система/Настройка/Загрузка и инициализация
Пакет: SysVinit

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: sysvinit-2.86-deb-wall-ttyname.patch
Скачать


#! /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 <utmp.h> 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);
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin