Bug 281332 - tzsetup creates broken symlink after 5e16809c953f (main) and fc43a1b6842a (stable/14)
Summary: tzsetup creates broken symlink after 5e16809c953f (main) and fc43a1b6842a (st...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-09-07 08:17 UTC by Herbert J. Skuhra
Modified: 2024-10-03 12:05 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Herbert J. Skuhra 2024-09-07 08:17:20 UTC
tzsetup creates a broken symlink when using with -C option (e.g make installworld DESTDIR=$X). e.g:

# jexec -l 1 date
Sat Sep  7 10:13:19 CEST 2024
# ls -l /jails/mail/etc/localtime
lrwxr-xr-x  1 root wheel 33 Sep  7 10:13 /jails/mail/etc/localtime -> /usr/share/zoneinfo/Europe/Berlin
# tzsetup -C /jails/mail -r
# ls -l /jails/mail/etc/localtime
lrwxr-xr-x  1 root wheel 45 Sep  7 10:14 /jails/mail/etc/localtime -> /jails/mail//usr/share/zoneinfo/Europe/Berlin
# jexec -l 1 date
Sat Sep  7 08:14:45 UTC 2024

Details here:

https://lists.freebsd.org/archives/freebsd-current/2024-September/006355.html
https://lists.freebsd.org/archives/dev-commits-src-all/2024-August/044194.html
Comment 1 Joseph Mingrone freebsd_committer freebsd_triage 2024-09-20 14:59:07 UTC
There is some context at https://reviews.freebsd.org/D37005.
Comment 2 Ed Maste freebsd_committer freebsd_triage 2024-09-21 17:40:23 UTC
Immediate fix for the incorrect symlink at https://reviews.freebsd.org/D46725
Comment 3 Herbert J. Skuhra 2024-09-22 09:04:06 UTC
(In reply to Ed Maste from comment #2)
Thanks. So my suggested patch was almost correct. lol 
It works after running 'make buildworld installworld' twice. Maybe a note is required for UPDATING?
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-09-30 14:23:25 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=030c387f5d74a66d0d5950e3450d6da24237fb2e

commit 030c387f5d74a66d0d5950e3450d6da24237fb2e
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-09-21 11:13:27 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-09-30 14:22:34 +0000

    tzsetup: correct timezone symlink target

    In chroot mode tzsetup prepended the chroot path to the symlink target,
    which is not correct.  Use the same path for the symlink regardless of
    chroot mode.

    PR:             281332
    Reported by:    scf, Herbert J. Skuhra
    Reviewed by:    olce
    Fixes: 5e16809c953f ("tzsetup: symlink /etc/localtime instead of co...")
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D46725

 usr.sbin/tzsetup/tzsetup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 5 Ed Maste freebsd_committer freebsd_triage 2024-10-03 12:05:20 UTC
Fixed: the MFC'd change was reverted from stable/14, so the bug existed only in main.