diff options
author | Daniel Kolesa <daniel@octaforge.org> | 2022-10-29 18:18:02 +0200 |
---|---|---|
committer | Daniel Kolesa <daniel@octaforge.org> | 2022-12-22 15:11:09 +0100 |
commit | 790a62e9f36e82b753c3c115267516a88d48ed82 (patch) | |
tree | 35c81ee0453207c16704e568fb57f1a262a4e6bd /src/fs_fsys.c | |
parent | 6508596be6b2e4c897034dcef72e9df09502f419 (diff) | |
download | apk-tools-790a62e9f36e82b753c3c115267516a88d48ed82.tar.gz apk-tools-790a62e9f36e82b753c3c115267516a88d48ed82.tar.bz2 apk-tools-790a62e9f36e82b753c3c115267516a88d48ed82.tar.xz apk-tools-790a62e9f36e82b753c3c115267516a88d48ed82.zip |
db: always have writable directories with --no-chown
The --no-chown flag is most useful when running apk as a regular
user, in which case we want to make sure that there are no issues
regarding permissions.
Fixes https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10854
Diffstat (limited to 'src/fs_fsys.c')
-rw-r--r-- | src/fs_fsys.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fs_fsys.c b/src/fs_fsys.c index c11ca50..218676b 100644 --- a/src/fs_fsys.c +++ b/src/fs_fsys.c @@ -57,6 +57,10 @@ static int fsys_dir_update_perms(struct apk_fsdir *d, mode_t mode, uid_t uid, gi if (fchmodat(fd, dirname, mode, 0) < 0) rc = -errno; } + + if (d->ac->db->extract_flags & APK_FSEXTRACTF_NO_CHOWN) + return rc; + if (st.st_uid != uid || st.st_gid != gid) { if (fchownat(fd, dirname, uid, gid, 0) < 0) rc = -errno; |