Subject: pkg/19581: More verbose error reporting for download-vulnerability-list
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kpneal@pobox.com>
List: netbsd-bugs
Date: 12/27/2002 15:59:29
>Number:         19581
>Category:       pkg
>Synopsis:       More verbose error reporting for download-vulnerability-list
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 27 13:05:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Kevin P. Neal
>Release:        NetBSD 1.6
>Organization:
-- 
Kevin P. Neal                                http://www.pobox.com/~kpn/

"You know, I think I can hear the machine screaming from here...  \
'help me! hellpp meeee!'"  - Heather Flanagan, 14:52:23 Wed Jun 10 1998
>Environment:
System: NetBSD rune.neutralgood.org 1.6 NetBSD 1.6 (RUNE-$Revision: 1.1 $) #7: Sun Sep 22 20:32:24 EDT 2002 kpn@neutralgood.org:/local/kernel/compile/RUNE alpha
Architecture: alpha
Machine: alpha
>Description:

The download-vulnerability-list script (part of the audit-packages pkg)
downloads the latest copy of distfiles/vulnerabilities. If there is an
error during the ftp then the script will overwrite the old version of
the file with an empty copy. Then the script will complain that the new
version is too small. 

My change simply makes the script bail when ftp fails, reporting the error
to the user in the process. 

>How-To-Repeat:

Run download-vulnerability-list and have it fail. 

>Fix:

*** download-vulnerability-list.orig    Thu Dec 26 20:17:07 2002
--- download-vulnerability-list Fri Dec 27 15:54:18 2002
***************
*** 12,15 ****
--- 12,21 ----
  
  /usr/bin/ftp -o ${NEW_VUL_LIST} ${VUL_SOURCE}
+ ftpstatus=$?
+ 
+ if [ $ftpstatus -gt 0 ]; then
+       echo "Error $ftpstatus from ftp when downloading vulnerability list."
+       exit $ftpstatus
+ fi
  existsize=0
  newsize=0

>Release-Note:
>Audit-Trail:
>Unformatted: