NetBSD Problem Report #20196

Received: (qmail 17264 invoked by uid 605); 4 Feb 2003 08:19:50 -0000
Message-Id: <20030204081946.7378B1B3083@zembla.Princeton.EDU>
Date: Tue,  4 Feb 2003 03:19:46 -0500 (EST)
From: Christopher Richards <richards+netbsd@CS.Princeton.EDU>
Sender: gnats-bugs-owner@netbsd.org
Reply-To: richards+netbsd@CS.Princeton.EDU
To: gnats-bugs@gnats.netbsd.org
Subject: etcupdate -a compares "md5" output to "sum" output
X-Send-Pr-Version: 3.95

>Number:         20196
>Category:       bin
>Synopsis:       etcupdate -a compares "md5" output to "sum" output
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 04 08:20:00 +0000 2003
>Closed-Date:    Tue Feb 04 08:33:56 +0000 2003
>Last-Modified:  Tue Feb 04 08:33:56 +0000 2003
>Originator:     Christopher Richards
>Release:        NetBSD 1.6_STABLE
>Organization:

>Environment:


System: NetBSD zembla.Princeton.EDU 1.6_STABLE NetBSD 1.6_STABLE (ZEMBLA) #46: Thu Jan 30 01:03:21 EST 2003 richards@zembla.Princeton.EDU:/home/richards/z/src/kern i386
Architecture: i386
Machine: i386
>Description:
	Running "etcupdate -a" stores checksums in MD5 format.  These
	checksums are compared to checksums in "sum" format, however, so
	the comparison is always false, rendering "-a" a nop.

>How-To-Repeat:
	Code inspection.

>Fix:
	Patch follows.  (Should apply to -current, too.)

Index: usr.sbin/etcupdate/etcupdate
===================================================================
RCS file: /cvsroot/src/usr.sbin/etcupdate/etcupdate,v
retrieving revision 1.3.2.5
diff -u -b -r1.3.2.5 etcupdate
--- usr.sbin/etcupdate/etcupdate	2003/01/27 06:44:39	1.3.2.5
+++ usr.sbin/etcupdate/etcupdate	2003/02/04 08:10:02
@@ -164,7 +164,7 @@
 	fi

 	if [ "${AUTOMATIC}" = "YES" -a -f "/etc/etcupdate/${1}"  ] ; then
-		SUM1=`sum "${1}"`
+		SUM1=`md5 "${1}"`
 		SUM2=`cat "/etc/etcupdate/${1}"`
 		if [ "${SUM1}" = "${SUM2}" ] ; then
 			install_file "${1}"

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: martti 
State-Changed-When: Tue Feb 4 00:33:30 PST 2003 
State-Changed-Why:  
Fixed, thanks for spotting this. 
>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.