summaryrefslogtreecommitdiff
path: root/src/archive.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-12 13:43:29 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-06-12 13:43:29 +0300
commit3062d681f9052aabd4e02884e67a0fa1cf413f8b (patch)
tree13005e78d400349314753d326a18efe78d51cc70 /src/archive.c
parent43cb554c3fd94ba394b708265c5fa2225a37a9eb (diff)
downloadapk-tools-3062d681f9052aabd4e02884e67a0fa1cf413f8b.tar.gz
apk-tools-3062d681f9052aabd4e02884e67a0fa1cf413f8b.tar.bz2
apk-tools-3062d681f9052aabd4e02884e67a0fa1cf413f8b.tar.xz
apk-tools-3062d681f9052aabd4e02884e67a0fa1cf413f8b.zip
archive: honor username/groupname instead of uid/gid
Take the uid/gid from passwd and group.
Diffstat (limited to 'src/archive.c')
-rw-r--r--src/archive.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/archive.c b/src/archive.c
index e7260b6..f60cb1b 100644
--- a/src/archive.c
+++ b/src/archive.c
@@ -388,7 +388,10 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae,
break;
}
if (r == 0) {
- r = fchownat(atfd, fn, ae->uid, ae->gid, atflags);
+ r = fchownat(atfd, fn,
+ apk_resolve_uid(ae->uname, ae->uid),
+ apk_resolve_gid(ae->gname, ae->gid),
+ atflags);
if (r < 0) {
apk_error("Failed to set ownership on %s: %s",
fn, strerror(errno));