Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37707875
en ru br
Репозитории ALT
S:3.20.1-alt2
5.1: 3.7.9-alt0.M51.1
4.1: 3.6.2-alt4
4.0: 3.6.2-alt4
3.0: 3.6.2-alt3
www.altlinux.org/Changes

Группа :: Работа с файлами
Пакет: logrotate

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

Патч: logrotate-alt-file_type.patch
Скачать


--- logrotate/config.c
+++ logrotate/config.c
@@ -771,8 +771,8 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
     }
     if (!S_ISREG(sb.st_mode)) {
 	message(MESS_DEBUG,
-		"Ignoring %s because it's not a regular file.\n",
-		configFile);
+		"Ignoring %s because of unacceptable file type %#o.\n",
+		configFile, sb.st_mode & S_IFMT);
 	close(fd);
 	return 0;
     }
--- logrotate/logrotate.c
+++ logrotate/logrotate.c
@@ -1022,17 +1022,16 @@ int findNeedRotating(struct logInfo *log, int logNum, int force)
 	return 1;
     }
 
+    if (!S_ISREG(sb.st_mode)) {
+	message(MESS_DEBUG, "  log %s has unacceptable file type %#o, skipping.\n",
+		log->files[logNum], sb.st_mode & S_IFMT);
+	return 0;
+    }
+
     state = findState(log->files[logNum]);
     state->doRotate = 0;
     state->sb = sb;
 
-	if ((sb.st_mode & S_IFMT) == S_IFLNK) {
-	    message(MESS_DEBUG, "  log %s is symbolic link. Rotation of symbolic"
-			" links is not allowed to avoid security issues -- skipping.\n",
-		    log->files[logNum]);
-		return 0;
-	}
-
     if (force) {
 	/* user forced rotation of logs from command line */
 	state->doRotate = 1;   
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin