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

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

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

Патч: stmpclean-0.3-alt-ctime-mtime.patch
Скачать


--- stmpclean-0.3/stmpclean.c
+++ stmpclean-0.3/stmpclean.c
@@ -89,7 +89,7 @@ static uid_t	start_uid = -1;
 static int      am_tmpwatch;
 /* Time at the start of the program, in seconds since beginning of epoch. */
 static time_t   now;
-/* Minimum age (atime) of a file or empty directory to be deleted. */
+/* Minimum age (atime/ctime/mtime) of a file or empty directory to be deleted. */
 static int      minage;
 /* Current working directory is used for logging purposes only. */
 static char     cwd[MAXPATHLEN];
@@ -356,7 +356,10 @@ clean_dir(dir, depth, specified)
 			/* Looking at a directory. */
 			if (isemptydir(dp->d_name)) {
 				/* Looking at an empty directory. */
-				if (now - st.st_atime > minage && st.st_uid) {
+				if (st.st_uid
+				    && (now - st.st_atime > minage)
+				    && (now - st.st_ctime > minage)
+				    && (now - st.st_mtime > minage)) {
 					/* An old non-root owned directory. */
 					setecreds(st.st_uid, st.st_gid, dir,
 					          dp->d_name);
@@ -393,8 +396,10 @@ notempty:
 			}
 		} else {
 			/* Looking at a non-directory. */
-			if ((now - st.st_atime > minage)
-			    && st.st_uid
+			if (st.st_uid
+			    && (now - st.st_atime > minage)
+			    && (now - st.st_ctime > minage)
+			    && (now - st.st_mtime > minage)
 			    && (st.st_nlink == 1)
 			    && (((st.st_mode & S_IFMT) == S_IFREG)
 				|| ((st.st_mode & S_IFMT) == S_IFLNK))) {
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin