Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37729040
en ru br
ALT Linux repos
S:3.20.1-alt2
5.0: 3.6.2-alt4
4.1: 3.6.2-alt4
4.0: 3.6.2-alt4
3.0: 3.6.2-alt3

Group :: File tools
RPM: logrotate

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: logrotate-alt-file_type.patch
Download


--- 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;   
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin