Bug 2417003
| Summary: | Bad time in rsync daemon log | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Michal Ruprich <mruprich> |
| Component: | rsync | Assignee: | Michal Ruprich <mruprich> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 44 | CC: | luhliari, mruprich, ssorce |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | rsync-3.4.1-7.fc44 rsync-3.4.1-6.fc43 | Doc Type: | --- |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2026-05-15 20:57:38 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Michal Ruprich
2025-11-25 12:24:55 UTC
Found explanation and solution
/etc/localtime is needed to compute localtime.
rsync have code to initialize timezone before chroot, this is even documented (in log_init)
/* This looks pointless, but it is needed in order for the
* C library on some systems to fetch the timezone info
* before the chroot. */
timestring(time(NULL));
Notice: a tzset call is probably enough here
BUT, localtime do a tzset on each call, so after chroot, this fails
From glibc code (__tz_convert function)
tzset_internal (tp == &_tmbuf && use_localtime);
Solution is to use the thread safe localtime_r function
Checking using a small (attached) test
# /home/remi/test/tz tzset chroot localtime
TimeZone : CET/CEST
chroot : OK
TimeZone : CET/CEST
localtime : 2025/01/31 07:39:48
TimeZone : UTC/UTC
# /home/remi/test/tz tzset chroot localtime_r
TimeZone : CET/CEST
chroot : OK
TimeZone : CET/CEST
localtime_r: 2025/01/31 08:40:04
TimeZone : CET/CEST
Filed as a PR Upstream: https://github.com/RsyncProject/rsync/pull/730 FEDORA-2026-d4d8ae2bdc (rsync-3.4.1-6.fc43) has been submitted as an update to Fedora 43. https://bodhi.fedoraproject.org/updates/FEDORA-2026-d4d8ae2bdc FEDORA-2026-75599531db (rsync-3.4.1-7.fc44) has been submitted as an update to Fedora 44. https://bodhi.fedoraproject.org/updates/FEDORA-2026-75599531db FEDORA-2026-75599531db has been pushed to the Fedora 44 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-75599531db` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-75599531db See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2026-d4d8ae2bdc has been pushed to the Fedora 43 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-d4d8ae2bdc` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-d4d8ae2bdc See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2026-75599531db (rsync-3.4.1-7.fc44) has been pushed to the Fedora 44 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2026-d4d8ae2bdc (rsync-3.4.1-6.fc43) has been pushed to the Fedora 43 stable repository. If problem still persists, please make note of it in this bug report. |