Subject: pkg/19581: More verbose error reporting for download-vulnerability-list
To: None <>
From: None <>
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
>Originator:     Kevin P. Neal
>Release:        NetBSD 1.6
Kevin P. Neal                      

"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
System: NetBSD 1.6 NetBSD 1.6 (RUNE-$Revision: 1.1 $) #7: Sun Sep 22 20:32:24 EDT 2002 alpha
Architecture: alpha
Machine: alpha

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. 


Run download-vulnerability-list and have it fail. 


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