Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Nov 2011 07:59:23 +0100 (CET)
From:      Helge Oldach <src-mergemaster-nov11@oldach.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Doug Barton <dougb@FreeBSD.org>
Subject:   bin/162891: [patch] mergemaster -D runs tzsetup improperly
Message-ID:  <201111260659.pAQ6xNig053229@sep.oldach.net>
Resent-Message-ID: <201111260720.pAQ7K9XO055846@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         162891
>Category:       bin
>Synopsis:       [patch] mergemaster -D runs tzsetup improperly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 26 07:20:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Helge Oldach
>Release:        FreeBSD 8.2-1005 i386
>Organization:
>Environment:

System: FreeBSD localhost 8.2-1005 FreeBSD 8.2-1005 #0: Thu Nov 17 18:26:10 CET 2011 toor@localhost:/usr/obj/usr/src/sys/HMO i386

>Description:

When mergemaster'ing a destination directory with the -D option, and no
${DESTDIR}/var/db/zoneinfo exists, tzsetup is not run chroot'ed. This
causes tzsetup to create a fresh /var/db/zoneinfo instead of the
intended ${DESTDIR}/var/db/zoneinfo.

>How-To-Repeat:

Run mergemaster twice without ${DESTDIR}/var/db/zoneinfo - it will run
tzsetup again.

>Fix:

--- /usr/sbin/mergemaster~	2011-11-17 22:08:54.000000000 +0100
+++ /usr/sbin/mergemaster	2011-11-26 07:44:41.000000000 +0100
@@ -1338,14 +1338,14 @@
 
 if [ -e "${DESTDIR}/etc/localtime" ]; then	# Ignore if TZ == UTC
   echo ''
+  [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}"
   if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then
     echo "*** Reinstalling `cat ${DESTDIR}/var/db/zoneinfo` as ${DESTDIR}/etc/localtime"
-    [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}"
     tzsetup $tzs_args -r
   else
     echo "*** There is no ${DESTDIR}/var/db/zoneinfo file to update ${DESTDIR}/etc/localtime."
     echo '    You should run tzsetup'
-    run_it_now tzsetup
+    run_it_now "tzsetup $tzs_args"
   fi
 fi
 

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111260659.pAQ6xNig053229>