Subject: pkg/30246: download-vulnerability-list doesn't use FETCH_CMD
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 05/16/2005 17:57:00
>Number:         30246
>Category:       pkg
>Synopsis:       download-vulnerability-list doesn't use FETCH_CMD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 16 17:57:00 +0000 2005
>Release:        NetBSD 1.6.2_STABLE
System: NetBSD 1.6.2_STABLE NetBSD 1.6.2_STABLE (MYKERNEL) #1: Tue Jun 1 12:16:43 PDT 2004 i386
Architecture: i386
Machine: i386
I noticed that the code for figuring out the fetch command and that
complaint of unknown fetch command probably should be done at pkgsrc
build time of the package and not needed in the end result script.

I was then told that the FETCH_CMD can be used to allow people
to use their own utility.

But it doesn't work that way.

Have a look at template:

utility=`echo "@FETCH_CMD@" | @AWK@ '{ print $1 }'`
case "$utility" in

And the end resulting script:

utility=`echo "/usr/bin/ftp" | /usr/bin/awk '{ print $1 }'`
case "$utility" in
*curl)  /usr/bin/ftp ${FETCH_ARGS} -o ${NEW_VUL_LIST} ${VUL_SOURCE} ;;
*ftp)   /usr/bin/ftp ${FETCH_ARGS} -o ${NEW_VUL_LIST} ${VUL_SOURCE} ;;
*wget)  /usr/bin/ftp ${FETCH_ARGS} -O ${NEW_VUL_LIST} ${VUL_SOURCE} ;;
*fetch) /usr/bin/ftp ${FETCH_ARGS} -o ${NEW_VUL_LIST} ${VUL_SOURCE} ;;

The utility is hard-coded once you install as shown above.

Notice that curl, wget, fetch would never match in examples (using default
ftp) as this was implemented.

Install audit-packages and look at the code for the installed

Notice how it has tests for the fetch command that are
never used.

I haven't tested by change

And then earlier set: