NetBSD Problem Report #45717

From campbell@mumble.net  Fri Dec 16 21:16:47 2011
Return-Path: <campbell@mumble.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4BCD063BF13
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 16 Dec 2011 21:16:47 +0000 (UTC)
Message-Id: <20111216211648.7C3EC982AC@pluto.mumble.net>
Date: Fri, 16 Dec 2011 21:16:48 +0000 (UTC)
From: Taylor R Campbell <campbell+pkgsrc@mumble.net>
Reply-To: Taylor R Campbell <campbell+pkgsrc@mumble.net>
To: gnats-bugs@gnats.NetBSD.org
Subject: print/LPRng-core requests chown and chgrp incorrectly (or, bad interaction between UNPRIVILEGED=yes and USE_TOOLS+= chown:run)
X-Send-Pr-Version: 3.95

>Number:         45717
>Category:       pkg
>Synopsis:       print/LPRng-core requests chown and chgrp incorrectly (or, bad interaction between UNPRIVILEGED=yes and USE_TOOLS+= chown:run)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 16 21:20:00 +0000 2011
>Closed-Date:    
>Last-Modified:  Sun Jan 20 21:44:55 +0000 2013
>Originator:     Taylor R Campbell <campbell+pkgsrc@mumble.net>
>Release:        pkgsrc-2011Q3 (problem persists in HEAD)
>Organization:
>Environment:
System: NetBSD oberon.local 5.99.58 NetBSD 5.99.58 (RIAMONOHACK) #4: Sat Dec 10 23:18:29 UTC 2011 root@oberon.local:/home/riastradh/netbsd/current/obj/sys/arch/i386/compile/RIAMONOHACK i386
Architecture: i386
Machine: i386
>Description:

	print/LPRng-core fails the work-directory references check if
	built with UNPRIVILEGED=yes PKG_DEVELOPER=yes:

=> Checking for work-directory references in LPRng-core-3.8.28nb3
ERROR: /pkg/2011Q3/pkg/sbin/checkpc:    Binary file /tmp/pkg/2011Q3/work/print/LPRng-core/work/.destdir/pkg/2011Q3/pkg/sbin/checkpc matches
ERROR: *** The above files still have references to the build directory.
ERROR:     This is possibly an error that should be fixed by unwrapping
ERROR:     the files or adding missing tools to the package makefile!

	This is because it requests the chown and chgrp tools for
	build-time with `USE_TOOLS+= chown chgrp', and then remembers
	the tooldir pathnames.  Instead, it should request the tools
	for run-time with `USE_TOOLS+= chown:run chgrp:run'.  However,
	that's not enough to fix the problem -- it still fails the
	work-directory references check.

	I believe this is a symptom of a more general problem.  In
	particular, unprivileged.mk sets `TOOLS_PLATFORM.chown=${TRUE}
	chown', and likewise for chgrp.  This has the effect that
	${CHOWN} (and ${TOOLS_CHOWN}, and ${TOOLS_CMDLINE_CHOWN}, and
	${TOOLS_PLATFORM.chown}) are all wrong when I've requested the
	chown tool at run-time with `USE_TOOLS+= chown:run'.

>How-To-Repeat:

	Try to build print/LPRng-core with UNPRIVILEGED=yes and
	PKG_DEVELOPER=yes.  Or,

% cd /usr/pkgsrc/print/LPRng-core
% make show-vars 'VARNAMES=CHOWN TOOLS_CHOWN TOOLS_CMDLINE_CHOWN TOOLS_PLATFORM.chown' MAKECONF=/dev/null
/usr/sbin/chown
/usr/sbin/chown
/usr/sbin/chown
/usr/sbin/chown
% make show-vars 'VARNAMES=CHOWN TOOLS_CHOWN TOOLS_CMDLINE_CHOWN TOOLS_PLATFORM.chown' UNPRIVILEGED=yes MAKECONF=/dev/null
true chown
true
true
true chown

>Fix:

	Yes, please!

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 24 Apr 2012 02:39:32 +0000
State-Changed-Why:
I may have fixed this a couple days ago; please try.
(It should not longer generate workdir references; it might
end up compiling in "true" for chown/chgrp though, which
would still be a bug.)


From: Taylor R Campbell <campbell+pkgsrc@mumble.net>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org,
	gnats-admin@netbsd.org, dholland@NetBSD.org
Subject: Re: pkg/45717 (print/LPRng-core requests chown and chgrp incorrectly (or, bad interaction between UNPRIVILEGED=yes and USE_TOOLS+= chown:run))
Date: Sun, 20 Jan 2013 05:25:06 +0000

    Date: Tue, 24 Apr 2012 02:39:33 +0000 (UTC)
    From: dholland@NetBSD.org

    I may have fixed this a couple days ago; please try.
    (It should not longer generate workdir references; it might
    end up compiling in "true" for chown/chgrp though, which
    would still be a bug.)

 This is indeed what happens, as inspection of config.status reveals.

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 20 Jan 2013 21:44:55 +0000
State-Changed-Why:
not fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.