NetBSD Problem Report #35091

From dholland@eecs.harvard.edu  Wed Nov 22 04:29:08 2006
Return-Path: <dholland@eecs.harvard.edu>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id AED0363B400
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 22 Nov 2006 04:29:08 +0000 (UTC)
Message-Id: <20061122022319.0BD38F8C2@tanaqui.eecs.harvard.edu>
Date: Tue, 21 Nov 2006 21:23:18 -0500 (EST)
From: dholland@eecs.harvard.edu
Reply-To: dholland@eecs.harvard.edu
To: gnats-bugs@NetBSD.org
Subject: make update erases packages before vulnerability check
X-Send-Pr-Version: 3.95

>Number:         35091
>Category:       pkg
>Synopsis:       make update erases packages before vulnerability check
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 22 04:30:00 +0000 2006
>Closed-Date:    Tue Jun 15 04:22:52 +0000 2010
>Last-Modified:  Tue Jun 15 04:22:52 +0000 2010
>Originator:     David A. Holland <dholland@eecs.harvard.edu>
>Release:        NetBSD 4.99.3 (pkgsrc of 20061120)
>Organization:
    Harvard EECS
>Environment:
System: NetBSD tanaqui 4.99.3 NetBSD 4.99.3 (TANAQUI) #6: Tue Oct 10 19:32:37 EDT 2006 dholland@tanaqui:/usr/src/sys/arch/i386/compile/TANAQUI i386
Architecture: i386
Machine: i386
>Description:

If you do "make update" in a vulnerable package, it erases the package
first and then fails because of the vulnerability.

One can repeat with ALLOW_VULNERABLE_PACKAGES=1, so it's not a big
deal, but it can be a nuisance, especially if you do something like
"sleep 600; make update" and go off to lunch.

>How-To-Repeat:

Choose a package with an outstanding vul, build and install it with
ALLOW_VULNERABLE_PACKAGES=1, make clean, and then make update without
ALLOW_VULNERABLE_PACKAGES=1.

>Fix:

If I understand correctly it should be sufficient to add

${_PKG_SILENT}${_PKG_DEBUG}${RECURSIVE_MAKE} ${MAKEFLAGS} check-vulnerable

as the very first command for the update: rule in bsd.pkg.update.mk,
right before the similar invocation of update-create-ddir.

But I haven't actually tried this and I'm not a pkgsrc wizard.

(This won't stop it from erasing and not rebuilding descendent
packages, but that's an entirely different can of worms, and, I think,
less important.)

>Release-Note:

>Audit-Trail:
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/35091: make update erases packages before vulnerability check
Date: Wed, 22 Nov 2006 09:44:11 +0100

 On Wed, Nov 22, 2006 at 04:30:00AM +0000, dholland@eecs.harvard.edu wrote:
 > If I understand correctly it should be sufficient to add
 > 
 > ${_PKG_SILENT}${_PKG_DEBUG}${RECURSIVE_MAKE} ${MAKEFLAGS} check-vulnerable

 I think it is even simpler to just add a dependency of update on
 check-vulnerable. I have no means to test that though. Don't forget to
 do that in both cases.

 Joerg

From: dholland@eecs.harvard.edu (David Holland)
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/35091: make update erases packages before vulnerability check
Date: Mon, 4 Dec 2006 18:35:35 -0500 (EST)

  >  On Wed, Nov 22, 2006 at 04:30:00AM +0000, dholland@eecs.harvard.edu wrote:
  >  > If I understand correctly it should be sufficient to add
  >  > 
  >  > ${_PKG_SILENT}${_PKG_DEBUG}${RECURSIVE_MAKE} ${MAKEFLAGS} check-vulnerable
  >  
  >  I think it is even simpler to just add a dependency of update on
  >  check-vulnerable. I have no means to test that though. Don't forget to
  >  do that in both cases.

 Doing it that way you need to be careful, because there's a 
 ".if !target(update)" in there and declaring the dependency before it
 will make it do the wrong thing. It also isn't clear that there aren't
 other instances of this elsewhere.

 Anyway, I've now tested the change I suggested and it at least does
 work.

 -- 
    - David A. Holland / dholland@eecs.harvard.edu

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/35091 CVS commit: pkgsrc/mk
Date: Tue, 15 Jun 2010 04:14:26 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Tue Jun 15 04:14:26 UTC 2010

 Modified Files:
 	pkgsrc/mk: bsd.pkg.update.mk

 Log Message:
 Apply my fix for PR 35091: do a check-vulnerable step first in "make
 update", so if it's going to fail because of a known vulnerability it
 does so before uninstalling anything. I've been carrying this patch
 for some three years with no ill effects. Ok by agc@.


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 pkgsrc/mk/bsd.pkg.update.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 15 Jun 2010 04:22:52 +0000
State-Changed-Why:
fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.