From nobody Sun Sep 01 21:12:46 2024 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxl423Z44z5PTqQ for ; Sun, 01 Sep 2024 21:13:38 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wxl412C2Fz4FmP; Sun, 1 Sep 2024 21:13:37 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail202005 header.b=Bax8HhT6; dmarc=none; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 94.130.200.20 as permitted sender) smtp.mailfrom=herbert@gojira.at Date: Sun, 01 Sep 2024 23:12:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1725225207; bh=ByiL6Fev9xZCxee1TBneTDuNt+/XcVZsIQlS7c47vkE=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=Bax8HhT6Moeam2e+fUl0TCzp8kbrpcCAssvAOmYMdj6RP24R7EXFqjjT60PN/KaMr 7JSiaz0sBQheH/EY7NqkODZNViW8PElcuOXeLJzEvtqBr+xcgrfrZeslJC/idEBHMp Aauj3Rp9xvGxNcWCio4jjVdm5PP3EBAG6M7U8J+G5EBN1vxRC2b7xouraW1sXSFZYK fh0ZvG7oOSyqgU63Xh2FxytiNw9RSo/v1raLYMo+KN8k/PrUIoG81+4fN6kS6NWEic 8ZYpDfWuC4jcEu4tMUbglvJcDR/Jzo3OLRtAiIBB98BstBQY3INz2ts8+IN5E6qvVL 9RPIAXBcyNE0g== Message-ID: <87frqjaxip.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: "Sean C. Farley" Cc: Ed Maste , current@FreeBSD.org Subject: Re: git: fc43a1b6842a - stable/14 - tzsetup: symlink /etc/localtime instead of copying In-Reply-To: <87zfoujxuj.wl-herbert@gojira.at> References: <202408011538.471FcJDS026885@gitrepo.freebsd.org> <784ce21d-a604-bb91-c52e-29c78e2bb6e4@FreeBSD.org> <87cylubd5v.wl-herbert@gojira.at> <87zfoujxuj.wl-herbert@gojira.at> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.46 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.957]; R_SPF_ALLOW(-0.20)[+ip4:94.130.200.20]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail202005]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:94.130.0.0/16, country:DE]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; DMARC_NA(0.00)[gojira.at]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[current@FreeBSD.org]; DKIM_TRACE(0.00)[gojira.at:+] X-Rspamd-Queue-Id: 4Wxl412C2Fz4FmP On Fri, 30 Aug 2024 09:04:04 +0200, "Herbert J. Skuhra" wrote: > > On Tue, 27 Aug 2024 10:09:00 +0200, "Herbert J. Skuhra" wrote: > > > > On Thu, 08 Aug 2024 06:35:38 +0200, "Sean C. Farley" wrote: > > > > > > On Thu, 1 Aug 2024, Ed Maste wrote: > > > > > > > The branch stable/14 has been updated by emaste: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > > > > > > commit fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > > Author: Ed Maste > > > > AuthorDate: 2022-10-14 16:44:35 +0000 > > > > Commit: Ed Maste > > > > CommitDate: 2024-08-01 15:11:45 +0000 > > > > > > > > tzsetup: symlink /etc/localtime instead of copying > > > > > > > > Using a symlink means that new timezone data (installed by an errata > > > > update, say) will be usable without having to be copied again. > > > > > > > > Reviewed by: bapt, kevans, philip > > > > Sponsored by: The FreeBSD Foundation > > > > Differential Revision: https://reviews.freebsd.org/D37005 > > > > > > > > (cherry picked from commit 5e16809c953f4cd19fadb1767469dec319de0353) > > > > > > I ran across an issue with this when using "etcupdate -D" to update a > > > jail from the host. "tzsetup -r -C /tmp/chroot", as called by > > > etcupdate, prepends the path of the chroot to the link which breaks > > > things inside the jail. > > > > I have this issue whenerver I update jails with 'make installworld > > DESTDIR=$X'. Will this be fixed or reverted (at least) in stable/14? > > Or works as expected? > > Maybe: > > diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c > index 617de4efb765..38d7ccf5e00c 100644 > --- a/usr.sbin/tzsetup/tzsetup.c > +++ b/usr.sbin/tzsetup/tzsetup.c > @@ -884,7 +884,7 @@ main(int argc, char **argv) > } else { > sprintf(path_zonetab, "%s/%s", chrootenv, _PATH_ZONETAB); > sprintf(path_iso3166, "%s/%s", chrootenv, _PATH_ISO3166); > - sprintf(path_zoneinfo, "%s/%s", chrootenv, _PATH_ZONEINFO); > + sprintf(path_zoneinfo, "%s", _PATH_ZONEINFO); > sprintf(path_localtime, "%s/%s", chrootenv, _PATH_LOCALTIME); > sprintf(path_db, "%s/%s", chrootenv, _PATH_DB); > sprintf(path_wall_cmos_clock, "%s/%s", chrootenv, Or: diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 617de4efb765..30d019214ab5 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -884,7 +884,7 @@ main(int argc, char **argv) } else { sprintf(path_zonetab, "%s/%s", chrootenv, _PATH_ZONETAB); sprintf(path_iso3166, "%s/%s", chrootenv, _PATH_ISO3166); - sprintf(path_zoneinfo, "%s/%s", chrootenv, _PATH_ZONEINFO); + strcpy(path_zoneinfo, _PATH_ZONEINFO); sprintf(path_localtime, "%s/%s", chrootenv, _PATH_LOCALTIME); sprintf(path_db, "%s/%s", chrootenv, _PATH_DB); sprintf(path_wall_cmos_clock, "%s/%s", chrootenv, With the unpatched version of tzsetup I get: 60294: open("/mnt//var/db/zoneinfo",O_RDONLY,0666) = 3 (0x3) 60294: fstat(3,{ mode=-rw-r--r-- ,inode=16728,size=14,blksize=4096 }) = 0 (0x0) 60294: read(3,"Europe/Berlin\n",4096) = 14 (0xe) 60294: access("/mnt//usr/share/zoneinfo/Europe/Berlin",R_OK) = 0 (0x0) 60294: unlink("/mnt//etc/localtime") = 0 (0x0) 60294: symlink("/mnt//usr/share/zoneinfo/Europe/Berlin","/mnt//etc/localtime") = 0 (0x0) 60294: open("/mnt//var/db/zoneinfo",O_WRONLY|O_CREAT|O_TRUNC,0666) = 4 (0x4) 60294: fstat(4,{ mode=-rw-r--r-- ,inode=16728,size=0,blksize=4096 }) = 0 (0x0) 60294: write(4,"Europe/Berlin\n",14) = 14 (0xe) # ls -l /mnt/etc/localtime lrwxr-xr-x 1 root wheel 38 Sep 1 22:30 /mnt/etc/localtime -> /mnt//usr/share/zoneinfo/Europe/Berlin And with the patched version: 61015: open("/mnt//var/db/zoneinfo",O_RDONLY,0666) = 3 (0x3) 61015: fstat(3,{ mode=-rw-r--r-- ,inode=16728,size=14,blksize=4096 }) = 0 (0x0) 61015: read(3,"Europe/Berlin\n",4096) = 14 (0xe) 61015: access("/usr/share/zoneinfo/Europe/Berlin",R_OK) = 0 (0x0) 61015: unlink("/mnt//etc/localtime") = 0 (0x0) 61015: symlink("/usr/share/zoneinfo/Europe/Berlin","/mnt//etc/localtime") = 0 (0x0) 61015: open("/mnt//var/db/zoneinfo",O_WRONLY|O_CREAT|O_TRUNC,0666) = 4 (0x4) 61015: fstat(4,{ mode=-rw-r--r-- ,inode=16728,size=0,blksize=4096 }) = 0 (0x0) 61015: write(4,"Europe/Berlin\n",14) = 14 (0xe) # ls -l /mnt/etc/localtime lrwxr-xr-x 1 root wheel 33 Sep 1 22:31 /mnt/etc/localtime -> /usr/share/zoneinfo/Europe/Berlin But maybe the link should be created like: # ls -l /mnt/etc/localtime lrwxr-xr-x 1 root wheel 38 Sep 1 23:07 /mnt/etc/localtime -> ../../usr/share/zoneinfo/Europe/Berlin -- Herbert