NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

install/50616: etcupdate installs checksums in the wrong directory



>Number:         50616
>Category:       install
>Synopsis:       etcupdate installs checksums in the wrong directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 03 03:30:00 +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}")"



Home | Main Index | Thread Index | Old Index