[PATCH] tzset_internal: do not reset old_tz if no change from default value

Dominique Martinet asmadeus@codewreck.org
Thu Feb 27 21:53:49 GMT 2025


Thanks for the quick reply.

Andreas Schwab wrote on Thu, Feb 27, 2025 at 04:50:28PM +0100:
> On Feb 28 2025, Dominique Martinet wrote:
> > tzset_internal returns early if tz is already set and did not change from old_tz,
> > but in case of default value it always reprocesses the value.
> 
> That's because /etc/localtime is just a link.

I'm not sure I understand this comment.
I guess it means that you want to check if the link changed, and that we
want to detect such changes?

If so I have a couple of questions:
- the `TZ` env var could point to a symlink just the same, what makes it
ok to not recheck the symlink in that case? (e.g. we should remember
"was a symlink" along with old_tz to enforce a recheck)
- even if it is a symlink, the value stored in old_tz is the link name
(/etc/localtime, not what the link actually contained - wouldn't it make
more sense to check the link first, and then update old_tz with that
only if the link changed? (e.g. looking at readlink() data or lstat()'s
mtime)


Thank you.


PS: Your mail went to spam and I almost didn't see it, it seems to have
been flagged by your outgoing server?
------
X-Spam-Level: ***************
X-Spam-Score: 15.33
X-Spamd-Bar: +++++++++++++++
X-Rspamd-Queue-Id: 6BCA92116C
X-Rspamd-Action: add header
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spam-Flag: YES
X-Spamd-Result: default: False [2.00 / 200.00];
        SPAM_FLAG(5.00)[];
        DWL_DNSWL_MED(-2.00)[suse.de:dkim];
        DMARC_POLICY_ALLOW(-0.50)[suse.de,none];
        R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
        R_SPF_ALLOW(-0.20)[+ip6:2a07:de40:b251:101:10:150:64:1/128];
        MIME_GOOD(-0.10)[text/plain];
        TO_DN_SOME(0.00)[];
        MIME_TRACE(0.00)[0:+];
        ARC_NA(0.00)[];
        ASN(0.00)[asn:29298, ipnet:2a07:de40:b240::/42, country:DE];
        MID_RHS_MATCH_FROM(0.00)[];
        RCPT_COUNT_TWO(0.00)[2];
        FROM_EQ_ENVFROM(0.00)[];
        FROM_HAS_DN(0.00)[];
        NEURAL_SPAM(0.00)[0.987];
        RCVD_COUNT_TWO(0.00)[2];
        RCVD_TLS_LAST(0.00)[];
        TO_MATCH_ENVRCPT_SOME(0.00)[];
        DKIM_TRACE(0.00)[suse.de:+]
X-TUID: x2llaO09kL+f
------

I'll try to keep an eye on my spam folder for further replies (or make
my rspamd trim flags set by external servers perhaps, just noticed I
have more of these from others...), but it'd be great if you could check
wth suse.
-- 
Dominique Martinet | Asmadeus


More information about the Libc-alpha mailing list