summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-06-01 11:21:46 +0300
committerTimo Teräs <timo.teras@iki.fi>2015-06-01 11:22:58 +0300
commit37b65f1c010bb98934448c726e26c64584d98e28 (patch)
tree01cc61a8b3c257055bba0b72b1a8dd2843f231c2 /src/database.c
parenteef2e02b294c95ad677b317a5360e03a8fb731ba (diff)
downloadapk-tools-37b65f1c010bb98934448c726e26c64584d98e28.tar.gz
apk-tools-37b65f1c010bb98934448c726e26c64584d98e28.tar.bz2
apk-tools-37b65f1c010bb98934448c726e26c64584d98e28.tar.xz
apk-tools-37b65f1c010bb98934448c726e26c64584d98e28.zip
fix directory permissions loading
commit 941fc1b1 uncovered a bug that directory permissions are not updated properly at db load time if it's the default acl.
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index c814957..478016b 100644
--- a/src/database.c
+++ b/src/database.c
@@ -758,6 +758,8 @@ int apk_db_index_read(struct apk_database *db, struct apk_bstream *bs, int repo)
if (pkg == NULL)
continue;
+ if (diri) apk_db_dir_apply_diri_permissions(diri);
+
if (repo >= 0) {
pkg->repos |= BIT(repo);
} else if (repo == -2) {
@@ -806,6 +808,7 @@ int apk_db_index_read(struct apk_database *db, struct apk_bstream *bs, int repo)
/* Check FDB special entries */
switch (field) {
case 'F':
+ if (diri) apk_db_dir_apply_diri_permissions(diri);
if (pkg->name == NULL) goto bad_entry;
diri = apk_db_diri_new(db, pkg, l, &diri_node);
file_diri_node = &diri->owned_files.first;
@@ -826,7 +829,7 @@ int apk_db_index_read(struct apk_database *db, struct apk_bstream *bs, int repo)
acl = apk_db_acl_atomize(mode, uid, gid, &xattr_csum);
if (field == 'M')
- apk_db_diri_set(diri, acl);
+ diri->acl = acl;
else
file->acl = acl;
break;