diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-07-09 14:59:40 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-07-09 14:59:40 +0300 |
commit | 5aa69984595c8f63899a39cbeae8c86913bfb2d2 (patch) | |
tree | 2013f8ecb584d8bdbde97aa031de10104636ce4f /src | |
parent | dde96976d33261a397042405bec28520a57a3451 (diff) | |
download | apk-tools-5aa69984595c8f63899a39cbeae8c86913bfb2d2.tar.gz apk-tools-5aa69984595c8f63899a39cbeae8c86913bfb2d2.tar.bz2 apk-tools-5aa69984595c8f63899a39cbeae8c86913bfb2d2.tar.xz apk-tools-5aa69984595c8f63899a39cbeae8c86913bfb2d2.zip |
audit: get right protection mask for base directories in the lists
Use the paths' protection mask where available instead of the parent
paths'. ref #1241
Diffstat (limited to 'src')
-rw-r--r-- | src/audit.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/audit.c b/src/audit.c index 03f977b..3a7cd3c 100644 --- a/src/audit.c +++ b/src/audit.c @@ -167,14 +167,22 @@ static int audit_directory_tree_item(void *ctx, int dirfd, const char *name) int recurse = TRUE; child = apk_db_dir_query(db, bfull); - if (actx->mode == MODE_BACKUP) { - if (!dbd->has_protected_children) - recurse = FALSE; - if (!dbd->protected) - goto recurse_check; + if (child != NULL) { + if (actx->mode == MODE_BACKUP) { + if (!child->has_protected_children) + recurse = FALSE; + if (!child->protected) + goto recurse_check; + } } else { - if (child == NULL) + if (actx->mode == MODE_BACKUP) { + if (!dbd->has_protected_children) + recurse = FALSE; + if (!dbd->protected) + goto recurse_check; + } else { recurse = FALSE; + } } reason = audit_directory(actx, db, child, &fi); |