NetBSD Problem Report #50616

From jbernard@knox.mines.edu  Sun Jan  3 03:25:24 2016
Return-Path: <jbernard@knox.mines.edu>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 138397ABF3
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  3 Jan 2016 03:25:24 +0000 (UTC)
Message-Id: <201601030210.u032AC4U016135@knox.mines.edu>
Date: Sat, 2 Jan 2016 19:10:12 -0700 (MST)
From: jbernard@mines.edu
Reply-To: jbernard@mines.edu
To: gnats-bugs@NetBSD.org
Subject: etcupdate installs checksums in the wrong directory
X-Send-Pr-Version: 3.95

>Number:         50616
>Category:       install
>Synopsis:       etcupdate installs checksums in the wrong directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    install-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 03 03:30:00 +0000 2016
>Closed-Date:    Sun Jan 03 08:38:54 +0000 2016
>Last-Modified:  Sun Jan 03 08:38:54 +0000 2016
>Originator:     Jim Bernard
>Release:        NetBSD 7.99.25
>Organization:
>Environment:
NetBSD 7.99.25 201512260025Z: amd64
Architecture: x86_64
Machine: amd64
>Description:
	"etcupdate -a" stores checksums in subdirectories of /var/etcupdate,
	specifically dev, etc, root, and var.  When it is used together with
	the "-d destdir" option, the checksums of unchanged files are written
	in subdirectories with those same names under /var/etcupdate/<destdir>,
	rather than /var/etcupdate.
>How-To-Repeat:
	etcupdate -a -l -d otherroot -s etcsrcdir

	or read the code in the first conditional block of the
	diff_and_merge_file() function.  It's obviously inconsistent with
	the intended meaning of the install_checksum() function (as documented
	with its definition) and with all other invocations of that function.

	Issuing the command leads to numerous error messages about missing
	directories, and many of the checksums then show up under
	/var/etcupdate/otherroot.
>Fix:
	This patch fixes the problem.  I checked the rest of the script
	and didn't find any other mistakes like this.

--- etcupdate-dist	2015-12-25 19:54:15.000000000 -0700
+++ etcupdate	2016-01-02 16:50:04.000000000 -0700
@@ -278,11 +278,11 @@
 	# $1 = target file (relative to ${DESTDIR})

 	if cmp -s "${TEMPROOT}${1}" "${DESTDIR}${1}"; then
 		verbose "===> ${1} (ok)"
 		rm -f "${TEMPROOT}${1}"
-		install_checksum "${DESTDIR}${1}"
+		install_checksum "${1}"
 		return
 	fi

 	if ${AUTOMATIC} && [ -f "${DESTDIR}/var/etcupdate/${1}" ]; then
 		SUM1="$(md5 "${1}")"

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sun, 03 Jan 2016 08:38:54 +0000
State-Changed-Why:
Duplicate of 50615


>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.