diff --git libpkg/pkg_add.c libpkg/pkg_add.c index 380dba7..98ea00c 100644 --- libpkg/pkg_add.c +++ libpkg/pkg_add.c @@ -356,11 +356,11 @@ do_extract(struct archive *a, struct archive_entry *ae, const char *location, } } /* enforce modes and creds */ - lchmod(pathname, archive_entry_perm(ae)); if (getenv("INSTALL_AS_USER") == NULL) { lchown(pathname, get_uid_from_archive(ae), get_gid_from_archive(ae)); } + lchmod(pathname, archive_entry_perm(ae)); #ifdef HAVE_CHFLAGS /* Restore flags */ if (set != 0)