xbps: merge patch from git master to use lchown(2) while unpacking.

This commit is contained in:
Juan RP 2013-03-17 17:17:34 +01:00
parent c9f6b184c2
commit f8d376af3c
2 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,25 @@
From 8d6f3b5029b889e2865fc8ace4a2eacb56e5962a Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
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 fd19250..bf37690 100644
--- lib/package_unpack.c
+++ 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,
--
1.8.1.3

View file

@ -1,7 +1,7 @@
# Template file for 'xbps'
pkgname=xbps
version=0.21
revision=5
revision=6
build_style=configure
configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin
--enable-static --enable-debug --enable-tests"