unpack: use lchown(2) to set proper uid/gid to symlinks.

This commit is contained in:
Juan RP 2013-03-17 17:13:07 +01:00
parent 70b89a88cc
commit 8d6f3b5029

View File

@ -408,7 +408,7 @@ unpack_archive(struct xbps_handle *xhp,
if ((!force && file_exists && skip_extract && (euid == 0)) &&
(((archive_entry_uid(entry) != st.st_uid)) ||
((archive_entry_gid(entry) != st.st_gid)))) {
if (chown(entry_pname,
if (lchown(entry_pname,
archive_entry_uid(entry),
archive_entry_gid(entry)) != 0) {
xbps_dbg_printf(xhp,