NetBSD Problem Report #38231

From jim@roc.bernard.org  Wed Mar 12 14:45:28 2008
Return-Path: <jim@roc.bernard.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 1EF2B63B8E3
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 12 Mar 2008 14:45:28 +0000 (UTC)
Message-Id: <20080312144522.A4EB88397@roc.bernard.org>
Date: Wed, 12 Mar 2008 08:45:22 -0600 (MDT)
From: jbernard@mines.edu
Reply-To: jbernard@mines.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: download-vulnerability-list -c option is broken
X-Send-Pr-Version: 3.95

>Number:         38231
>Category:       bin
>Synopsis:       download-vulnerability-list -c option is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 12 14:50:00 +0000 2008
>Closed-Date:    Thu Mar 13 08:38:27 +0000 2008
>Last-Modified:  Thu Mar 13 08:40:02 +0000 2008
>Originator:     Jim Bernard
>Release:        NetBSD 4.99.49
>Organization:
>Environment:
System: NetBSD 4.99.49 Mon Jan 21 19:17:34 MST 2008 i386
Architecture: i386
Machine: i386
>Description:
	The download-vulnerability-list script attempts to support the
	command-line option "-c config-file" to specify a config file
	other than the default /etc/audit-packages.conf.  But it processes
	the command-line arguments in a loop within which, while processing
	the "-c" flag, it stores the value of the following argument as the
	file name, but doesn't shift it off the list, so that on the next
	iteration that file name is processed as an option.  Since random
	file names aren't recognized as valid options, execution terminates.

	The bug is present in -current as of the date of this PR, not just
	the date of my last build.

>How-To-Repeat:
	Read the script or (e.g.):

	% echo "PKGVULNDIR=/tmp" > /tmp/xxx.conf
	% download-vulnerability-list -c /tmp/xxx.conf

	The result is:

	  Unknown option /tmp/xxx.conf
	  Usage: download-vulnerability-list [-s] [-c config-file]
		-s : Verify the signature on the downloaded file.
		-c : Specify a custom configuration file to use.

>Fix:
	shift past the argument of -c:

--- download-vulnerability-list.sh.in-dist	2007-11-04 03:30:11.000000000 -0700
+++ download-vulnerability-list.sh.in	2008-03-12 08:30:03.000000000 -0600
@@ -69,10 +69,11 @@
 		verify=yes
 		;;
 	-c)
 		custom_conf=yes
 		local_conf="$2"
+		shift
 		;;
 	*)
 		usage "$0" "Unknown option $1"
 	esac
 	shift

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Thu, 13 Mar 2008 08:38:27 +0000
State-Changed-Why:
Committed, thanks.


From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38231 CVS commit: pkgsrc/pkgtools/pkg_install/files/audit-packages
Date: Thu, 13 Mar 2008 08:37:43 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Thu Mar 13 08:37:43 UTC 2008

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files/audit-packages:
 	    download-vulnerability-list.sh.in

 Log Message:
 Fix download-vulnerability-list's -c option. From Jim Bernard in PR 38231.


 To generate a diff of this commit:
 cvs rdiff -r1.4 -r1.5 \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/download-vulnerability-list.sh.in

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

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38231 CVS commit: src/dist/pkg_install/audit-packages
Date: Thu, 13 Mar 2008 08:38:24 +0000 (UTC)

 Module Name:	src
 Committed By:	wiz
 Date:		Thu Mar 13 08:38:24 UTC 2008

 Modified Files:
 	src/dist/pkg_install/audit-packages: download-vulnerability-list.sh.in

 Log Message:
 Fix download-vulnerability-list's -c option. From Jim Bernard in PR 38231.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.4 -r1.2 \
     src/dist/pkg_install/audit-packages/download-vulnerability-list.sh.in

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

>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.