From nobody Sun Oct 26 00:02:05 2025 X-Original-To: bugs@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 4cvGz159Ywz6Dsg4 for ; Sun, 26 Oct 2025 00:02:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cvGz13LYTz3xKZ for ; Sun, 26 Oct 2025 00:02:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761436925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XZ2e5x2TebWjDGOOnEcReNzC6N6GNOYYKJt6juUG7nc=; b=hv1uN4oVuCS1uhg8AbJBFxvm3X8WWgYepjCOpJl/AV9AI75LMdBK/Otg8uhlVL4mGhIkR+ WN9cgdMxHJYAtv/2CMC/NQLxLcXI+RCTXMVSI+0SAcjPJSJ4tspE+xcg/fvaBtzrdLDgoS bkyfDhmzO2MhfSXRFu06TE8FCE/NfAp/XNfIEClHxDBoTIPlN0IcXZHtOB4kfQ+loKmZ+m 6j9Hmlx30ykNbqNdAbTy5iETKiL9NSpjGbdXFMPHJRWobl3Ty/gHBAMOG9APYmzoG2mZ8d DzCtUKj6DkGlnnJLxHYaj/7HAPOqtQJ4QXweiwtw/5gWHWOlkHRTiGeDp1NyXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761436925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XZ2e5x2TebWjDGOOnEcReNzC6N6GNOYYKJt6juUG7nc=; b=D9CfEmhgm8mlPoyUAJ5mKyuHdZv/zZoFNsPwjUln7ux17WvDbKz+buAnez+DfuD/6zNcx3 b/ByxFY+HCGBOsBnwoPOWHkos8Dws+NQ8F+AQBwK2x61iBS0k0SadGjFObRPC5gx2/Xf2F wg8Qtg30ldnxYr9Kv0sN01l5IqA8Bx/JXMweiMLRaBYU2cfBJ+iw2J7b4asiK1qX+bIv2a BQ2jHaEgz6mgMI4e+0mwfpZ2e+5nfr6q/mzZZVfEayQdSoMlM9tazRSeI5sgMNjNUV63xi +DzcfooxVV4c75TTTe4jHEWdqnd4io9nK7TKx8isImJ9MaB2ugmOyulCk55wZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761436925; a=rsa-sha256; cv=none; b=KfwBlPbx0yjNWOTOjyKKtD2DJIYEyPAZsCuwiGqHPxo7xuvca3clMzQB5NCOyIUtvj9XA2 gsDWpXPFRSY/Fh1YnreHzATkrkxL8LVpMGSH9e1yLD+Efv8Gdp95CLUQ4EQ6jztualGNtZ blp8JaJPmUWzfjbj1dLCL5oBAYhYBy+PWT5TeE6NviopthyTYzTQ754KZyU+gEp2Okhl0i hiR6OkfXYbuzy1m2Qg0xOz8S7PugBq48Jahy4jMj9SOHVaMcHcdl7b3g11ol5rS0wTx+MM 78tcLONCE2W/TFtGPIK+h5VKY6vx5EeSmcJxD4aAShItjwB5SeDT/R/yrdtLiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cvGz11snwz17cX for ; Sun, 26 Oct 2025 00:02:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 59Q025mp002432 for ; Sun, 26 Oct 2025 00:02:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 59Q025Ax002431 for bugs@FreeBSD.org; Sun, 26 Oct 2025 00:02:05 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 290520] Sync localtime, zic, zdump from circa 2025 tzcode Date: Sun, 26 Oct 2025 00:02:05 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: eggert@cs.ucla.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D290520 Bug ID: 290520 Summary: Sync localtime, zic, zdump from circa 2025 tzcode Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: eggert@cs.ucla.edu Created attachment 264886 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D264886&action= =3Dedit [PATCH 1/2] Prepare for syncing with upstream tzcode I recently changed tzcode upstream to simplify syncing it to FreeBSD. Attac= hed please find two patches to freebsd-src's main branch to do such a sync. The= se patches sync from TZDB's current main branch; if you'd prefer to wait for a TZDB release I can make such a release whenever it's convenient to help move this process forward. Aside from simplifying future maintenance (the main goal), the patches sync from TZDB's main branch, and therfore make the following behavior and implementation changes compared to what's in freebsd-src's main branch: * When zic -m or -u is used, create temp files with more-restrictive permissions, to fix some unlikely security races. * Use fchown and fchmod instead of chown and chmod, to fix some unlikely security races. * Do not mishandle diabolic environment settings like TZ=3D"/usr/share/zoneinfo/NZST-12NZDT,M9.5.0,M4.1.0/3". These settings shou= ld fail, and not be treated as if the leading "/usr/share/zoneinfo/" is missin= g. * Extend zic's -u OWNER option to also support -u OWNER:GROUP, like chown. * Move timestamp generation out of critical sections, to allow more parallelism. * Use CLOCK_MONOTONIC_COARSE instead of the slower CLOCK_MONOTONIC when DETECT_TZ_CHANGES is defined. * In the unlikely event that clock_gettime fails, assume the cached data are stale, as this is safer than assuming they're fresh. * localtime/gmtime/offtime no longer fail merely because they cannot alloca= te a thread-specific struct tm. * Treat ' ' like '_' in time zone abbreviations, to avoid breaking some timestamp parsers. * zic now is now consistent with zdump, in that it uses argv[0] for diagnos= tics if argv[0] is non-null. * zic now checks for duplicate -m, -g, and -u options. * zic now uses open + fdopen rather than umask + fopen, as this avoids confusion when the -m option specifies a symbolic mode whose behavior depen= ds on the umask. * Do not call stat/fstat twice on the same read-only file. * Do not fail merely because fstat fails (e.g., with EOVERFLOW). * Avoid an unnecessary duplicate lock in the gmtcheck function and macro. * Avoid an unnecessary malloc+free if tzload fails early. * Do not bother checking st_mtime; checking st_ctime suffices. * Use strnlen instead of strlen, to improve asymptotic performance. * Use mempcpy instead of memcpy when this seems helpful. * Avoid some unnecessary casts and/or use of too-wide types; instead, suppr= ess clang's false alarms by using its -Wno-sign-compare option. * Do not fail on a numeric mode merely because setmode fails with ENOMEM; instead, fall back on strtoul. --=20 You are receiving this mail because: You are the assignee for the bug.=