From 9c4b0991387ce808f05daeb077d582ced2700cda Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Sat, 17 Aug 2002 00:29:41 +0000 Subject: [PATCH] Fix extract for non-root users. Noticed by: nectar Pointy hat to: cy --- security/krb5-16/Makefile | 8 ++++++-- security/krb5-17/Makefile | 8 ++++++-- security/krb5-appl/Makefile | 8 ++++++-- security/krb5/Makefile | 8 ++++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/security/krb5-16/Makefile b/security/krb5-16/Makefile index 5406f50c601c..54537d1bcaa2 100644 --- a/security/krb5-16/Makefile +++ b/security/krb5-16/Makefile @@ -81,8 +81,12 @@ do-fetch: post-extract: @${TAR} -C ${WRKDIR} -xzf ${WRKDIR}/${DISTNAME}.tar.gz @${RM} ${WRKDIR}/${DISTNAME}.tar.gz ${WRKDIR}/${DISTNAME}.tar.gz.asc - @${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME} - @${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME} +.if !defined(EXTRACT_PRESERVE_OWNERSHIP) + @if [ `id -u` = 0 ]; then \ + ${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME}; \ + ${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME}; \ + fi +.endif .endif pre-build: diff --git a/security/krb5-17/Makefile b/security/krb5-17/Makefile index 5406f50c601c..54537d1bcaa2 100644 --- a/security/krb5-17/Makefile +++ b/security/krb5-17/Makefile @@ -81,8 +81,12 @@ do-fetch: post-extract: @${TAR} -C ${WRKDIR} -xzf ${WRKDIR}/${DISTNAME}.tar.gz @${RM} ${WRKDIR}/${DISTNAME}.tar.gz ${WRKDIR}/${DISTNAME}.tar.gz.asc - @${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME} - @${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME} +.if !defined(EXTRACT_PRESERVE_OWNERSHIP) + @if [ `id -u` = 0 ]; then \ + ${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME}; \ + ${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME}; \ + fi +.endif .endif pre-build: diff --git a/security/krb5-appl/Makefile b/security/krb5-appl/Makefile index 5406f50c601c..54537d1bcaa2 100644 --- a/security/krb5-appl/Makefile +++ b/security/krb5-appl/Makefile @@ -81,8 +81,12 @@ do-fetch: post-extract: @${TAR} -C ${WRKDIR} -xzf ${WRKDIR}/${DISTNAME}.tar.gz @${RM} ${WRKDIR}/${DISTNAME}.tar.gz ${WRKDIR}/${DISTNAME}.tar.gz.asc - @${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME} - @${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME} +.if !defined(EXTRACT_PRESERVE_OWNERSHIP) + @if [ `id -u` = 0 ]; then \ + ${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME}; \ + ${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME}; \ + fi +.endif .endif pre-build: diff --git a/security/krb5/Makefile b/security/krb5/Makefile index 5406f50c601c..54537d1bcaa2 100644 --- a/security/krb5/Makefile +++ b/security/krb5/Makefile @@ -81,8 +81,12 @@ do-fetch: post-extract: @${TAR} -C ${WRKDIR} -xzf ${WRKDIR}/${DISTNAME}.tar.gz @${RM} ${WRKDIR}/${DISTNAME}.tar.gz ${WRKDIR}/${DISTNAME}.tar.gz.asc - @${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME} - @${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME} +.if !defined(EXTRACT_PRESERVE_OWNERSHIP) + @if [ `id -u` = 0 ]; then \ + ${CHMOD} -R ug-s,go-w ${WRKDIR}/${DISTNAME}; \ + ${CHOWN} -R 0:0 ${WRKDIR}/${DISTNAME}; \ + fi +.endif .endif pre-build: