bin/162891: [patch] mergemaster -D runs tzsetup improperly

Helge Oldach src-mergemaster-nov11 at oldach.net
Sat Nov 26 07:20:09 UTC 2011


>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 at 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:


More information about the freebsd-bugs mailing list