diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-07-16 14:44:15 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-07-16 14:44:15 +0300 |
commit | ea5b08d1d574ae90ad6347a4d2f0a69bb656c7af (patch) | |
tree | af262b5e75472a38ff9f618afa71220ac8349698 /src/database.c | |
parent | 5aa69984595c8f63899a39cbeae8c86913bfb2d2 (diff) | |
download | apk-tools-ea5b08d1d574ae90ad6347a4d2f0a69bb656c7af.tar.gz apk-tools-ea5b08d1d574ae90ad6347a4d2f0a69bb656c7af.tar.bz2 apk-tools-ea5b08d1d574ae90ad6347a4d2f0a69bb656c7af.tar.xz apk-tools-ea5b08d1d574ae90ad6347a4d2f0a69bb656c7af.zip |
audit: fix protection mask of non-db directories
If a directory has protection mask, but does not exist in db, we
do not handle it right unless we calculate the protection mask by
hand, or create temporary db dir entry for it. For simplicity create
always the db dir entry -- depending on audit type we likely need
to create it anyway. This commit also caches the db dir entry in the
audit tree context to avoid duplicate lookups. ref #1241.
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c index bcc707f..efff29f 100644 --- a/src/database.c +++ b/src/database.c @@ -240,8 +240,7 @@ static void apk_db_dir_mkdir(struct apk_database *db, struct apk_db_dir *dir) ; } -static void apk_db_dir_unref(struct apk_database *db, struct apk_db_dir *dir, - int allow_rmdir) +void apk_db_dir_unref(struct apk_database *db, struct apk_db_dir *dir, int allow_rmdir) { dir->refs--; if (dir->refs > 0) { @@ -274,7 +273,7 @@ static void apk_db_dir_unref(struct apk_database *db, struct apk_db_dir *dir, apk_db_dir_unref(db, dir->parent, allow_rmdir); } -static struct apk_db_dir *apk_db_dir_ref(struct apk_db_dir *dir) +struct apk_db_dir *apk_db_dir_ref(struct apk_db_dir *dir) { dir->refs++; return dir; |