Date: Fri, 26 Sep 2003 15:37:13 -0400 From: Andrew Heybey <ath@niksun.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/57259: Building a port as root using an NFS-mounted /usr/ports fails Message-ID: <20030926153713.57ac7487.ath@niksun.com> Resent-Message-ID: <200309261940.h8QJeJ2J070842@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 57259 >Category: ports >Synopsis: Building a port as root using an NFS-mounted /usr/ports >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 26 12:40:18 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Andrew Heybey <ath@niksun.com> >Release: FreeBSD 4.8-RELEASE i386 >Organization: >Environment: System: FreeBSD celis.niksun.com 4.8-RELEASE FreeBSD 4.8-RELEASE #3: Sat Aug 23 21:29:00 EDT 2003 ath@celis.niksun.com:/y/src/sys/compile/CELIS i386 >Description: You cannot build a port as root using an NFS-mounted /usr/ports if the server maps root to a UID other than root. When extracting the source, tar thinks that it is root and attempts to chown the files that it extracts to the owner in the tar file. The chown fails, tar fails and thus the build fails. >How-To-Repeat: Mount /usr/ports on a client from a server with the following in /etc/exports: /usr/ports -maproot=ports:src (where the ports directory tree is writeable by ports:src). From a client machiine, mount /usr/ports over NFS then choose any port and do (as root): make EXTRACT_PRESERVE_OWNERSHIP=yes extract It will fails with messages that tar cannot change ownership of the files that it extracts. (EXTRACT_PRESERVE_OWNERSHIP needs to be defined to prevent bsd.port.mk from chowning the extracted tree to root). >Fix: Put tar's attempt to change ownership under control of the same EXTRACT_PRESERVE_OWNERSHIP variable: --- ports/Mk/bsd.port.mk.~1.461.~ Fri Aug 8 09:39:41 2003 +++ porst/Mk/bsd.port.mk Fri Sep 26 13:09:05 2003 @@ -1609,7 +1609,11 @@ EXTRACT_AFTER_ARGS?= -d ${WRKDIR} .else EXTRACT_BEFORE_ARGS?= -dc +.if defined(EXTRACT_PRESERVE_OWNERSHIP) +EXTRACT_AFTER_ARGS?= | ${TAR} -xf - --no-same-owner +.else EXTRACT_AFTER_ARGS?= | ${TAR} -xf - +.endif .if defined(USE_BZIP2) EXTRACT_CMD?= ${BZIP2_CMD} .else >Release-Note: >Audit-Trail: >Unformatted: >fails Severity: non-critical
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030926153713.57ac7487.ath>