2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-03 15:55:46 +00:00

use ctime for profiles, to detect newly installed profiles

This commit is contained in:
Kees Cook
2009-11-11 15:08:09 -08:00
parent d6a2f8258f
commit b2952da4bd

View File

@@ -613,9 +613,9 @@ int process_profile(int option, char *profilename)
if (!skip_read_cache &&
stat(cachename, &stat_bin) == 0 &&
stat_bin.st_size > 0 &&
(stat_bin.st_mtim.tv_sec > stat_text.st_mtim.tv_sec ||
(stat_bin.st_mtim.tv_sec == stat_text.st_mtim.tv_sec &&
stat_bin.st_mtim.tv_nsec >= stat_text.st_mtim.tv_nsec))) {
(stat_bin.st_mtim.tv_sec > stat_text.st_ctim.tv_sec ||
(stat_bin.st_mtim.tv_sec == stat_text.st_ctim.tv_sec &&
stat_bin.st_mtim.tv_nsec >= stat_text.st_ctim.tv_nsec))) {
if (show_cache) PERROR("Cache hit: %s\n", cachename);
retval = process_binary(option, cachename);
goto out;