From 8d6f3b5029b889e2865fc8ace4a2eacb56e5962a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 17 Mar 2013 17:13:07 +0100 Subject: [PATCH] unpack: use lchown(2) to set proper uid/gid to symlinks. --- lib/package_unpack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/package_unpack.c b/lib/package_unpack.c index fd192509..bf376900 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -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,