archive: resolve uid, gid for file information
the uid and gid are used in other places than just changing file ownership on extraction.cute-signatures
parent
5c4583a902
commit
28745420d0
|
@ -146,8 +146,8 @@ int apk_tar_parse(struct apk_istream *is, apk_archive_entry_parser parser,
|
||||||
|
|
||||||
entry = (struct apk_file_info){
|
entry = (struct apk_file_info){
|
||||||
.size = GET_OCTAL(buf.size),
|
.size = GET_OCTAL(buf.size),
|
||||||
.uid = GET_OCTAL(buf.uid),
|
.uid = apk_resolve_uid(buf.uname, GET_OCTAL(buf.uid)),
|
||||||
.gid = GET_OCTAL(buf.gid),
|
.gid = apk_resolve_gid(buf.gname, GET_OCTAL(buf.gid)),
|
||||||
.mode = GET_OCTAL(buf.mode) & 07777,
|
.mode = GET_OCTAL(buf.mode) & 07777,
|
||||||
.mtime = GET_OCTAL(buf.mtime),
|
.mtime = GET_OCTAL(buf.mtime),
|
||||||
.name = entry.name,
|
.name = entry.name,
|
||||||
|
@ -389,10 +389,7 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
r = fchownat(atfd, fn,
|
r = fchownat(atfd, fn, ae->uid, ae->gid, atflags);
|
||||||
apk_resolve_uid(ae->uname, ae->uid),
|
|
||||||
apk_resolve_gid(ae->gname, ae->gid),
|
|
||||||
atflags);
|
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
apk_error("Failed to set ownership on %s: %s",
|
apk_error("Failed to set ownership on %s: %s",
|
||||||
fn, strerror(errno));
|
fn, strerror(errno));
|
||||||
|
|
Loading…
Reference in New Issue