Timezone not detected from /etc/localtime

  • Open
  • quality assurance status badge
Details
2 participants
  • Distopico
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Distopico
Severity
normal
D
D
Distopico wrote on 12 Jan 23:41 +0100
Timezone not detected from /etc/localtime
(address . bug-guix@gnu.org)
874jfiku6y.fsf@riseup.net
Apps such as Icecat or ungoogled-chromium are not able to get the
correct timezone from /etc/localtime when `/etc/localtime` is a realpath
maybe because it expect /etc/share/zoneinfo, with readlink partially
works fine some apps, maybe related with an icu bug.[1]

I just removed manually `/etc/localtime` and crate an symlink `sudo ln
-s $TZDIR/$(cat /etc/timezone) /etc/localtime` and ungoogled-chromium
works fine.

Icecat in other hand has an additional bug related with icu[2][3]
and folder policy where `/gnu` is not allowed so in order to make it
work is necessary disable sandbox `MOZ_DISABLE_CONTENT_SANDBOX=1 icecat`
or set manually TZ env `TZ=$(cat /etc/timezone) icecat`, btw I have
`privacy.resistFingerprinting` false.

The weird thing is that in almost all of those reported the error is
the opposite where having a realpath solves it but in guix it is the
problem, perhaps it could be because these apps have updated their code
to make it work with `icu` v72 and guix has v71.

Steps to reproduce it:

- guix pull && guix package -u
- Install last icecat or ungoogled-chromium version
- Verify that you don't have $TZ set, unset it.
- If it's Icecat open `about:config` and set `privacy.resistFingerprinting` to false
- Check the timezone
- sudo rm -r /etc/localtime && sudo ln -s $TZDIR/$(cat /etc/timezone) /etc/localtime
- Open chromium or `MOZ_DISABLE_CONTENT_SANDBOX=1 icecat`
- Visit https://webbrowsertools.com/timezone/again, check the timezone.

See also:

Footnotes:


M
M
Maxim Cournoyer wrote on 19 Jan 05:32 +0100
(name . Distopico)(address . distopico@riseup.net)(address . 68411@debbugs.gnu.org)
877ck6j63h.fsf@gmail.com
Hi,

Distopico <distopico@riseup.net> writes:

Toggle quote (5 lines)
> Apps such as Icecat or ungoogled-chromium are not able to get the
> correct timezone from /etc/localtime when `/etc/localtime` is a realpath
> maybe because it expect /etc/share/zoneinfo, with readlink partially
> works fine some apps, maybe related with an icu bug.[1]

I don't know about ungoogled-chromium, but for IceCat, I had
investigated the problem at length in https://issues.guix.gnu.org/59368,
and it seems the bug is not in ICU but in Firefox, triggered in very
specific situations (resistFingerprinting defaults to true before user
prefs are loaded, and resetting the timezone fails in some javascript
that expects /etc/localtime to be a symlink, see:

--
Thanks,
Maxim
D
D
Distopico wrote on 24 Jan 16:00 +0100
Re: bug#68411: Timezone not detected from /etc/localtime
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 68411@debbugs.gnu.org)
874jf2ydf4.fsf@riseup.net
On 2024-01-18, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

Toggle quote (17 lines)
> Hi,
>
> Distopico <distopico@riseup.net> writes:
>
>> Apps such as Icecat or ungoogled-chromium are not able to get the
>> correct timezone from /etc/localtime when `/etc/localtime` is a realpath
>> maybe because it expect /etc/share/zoneinfo, with readlink partially
>> works fine some apps, maybe related with an icu bug.[1]
>
> I don't know about ungoogled-chromium, but for IceCat, I had
> investigated the problem at length in https://issues.guix.gnu.org/59368,
> and it seems the bug is not in ICU but in Firefox, triggered in very
> specific situations (resistFingerprinting defaults to true before user
> prefs are loaded, and resetting the timezone fails in some javascript
> that expects /etc/localtime to be a symlink, see:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1817004#c8).

But in icecat there is tow issues, one is related with the
/etc/localtime that expect a symlink but also there is another one
related with firefox sandbox, you can see here that `/usr` and `/nix`
was added to a whitelist, those paths is where they expect have the
zoneinfo files and `/gnu` is not in that whitelist (I already reported
to firefox), and disabling `MOZ_DISABLE_CONTENT_SANDBOX=1` it and with
the symlink the timezone works again.
-----BEGIN PGP SIGNATURE-----

iQFJBAEBCAAzFiEEvYwofabWO6y953lVmAk6gHJUa/MFAmWxKI8VHGRpc3RvcGlj
b0ByaXNldXAubmV0AAoJEJgJOoByVGvzt64H/itK+zRRGsgA3o+5kr211Fa/OI84
GLdNKTAYgu3YQSZsUH58hhg0LA2uiX1vrbuMES5vQrnHJSrbavN8Ljk92BNLKs6W
y7s7mVbpicILys6AI5Hv15IspHRJ58qOLEqFlkTxlDNhsbbqUyyOzZtkdJEym6+X
uPyipLr4xx7W6GuQ/HJv0kRDSbvrW6klByBQnBgLh0je/YG31eRk04D+1WaYaII/
gysDeEwmdkEyDbHxmt91pblELcGiqp8jI3OS/VzmvH4wy9O5IhcrGMUE0Bj1pPFU
ZDarKyeF5W5BWvG4vK2PA5LsNQGrVxUGvyqURjCkgyg44x+MSiKeR0UrN/g=
=cJuv
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 24 Jan 20:14 +0100
(name . Distopico)(address . distopico@riseup.net)(address . 68411@debbugs.gnu.org)
87o7dawnle.fsf@gmail.com
Hello,

Distopico <distopico@riseup.net> writes:

Toggle quote (27 lines)
> On 2024-01-18, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>> Hi,
>>
>> Distopico <distopico@riseup.net> writes:
>>
>>> Apps such as Icecat or ungoogled-chromium are not able to get the
>>> correct timezone from /etc/localtime when `/etc/localtime` is a realpath
>>> maybe because it expect /etc/share/zoneinfo, with readlink partially
>>> works fine some apps, maybe related with an icu bug.[1]
>>
>> I don't know about ungoogled-chromium, but for IceCat, I had
>> investigated the problem at length in https://issues.guix.gnu.org/59368,
>> and it seems the bug is not in ICU but in Firefox, triggered in very
>> specific situations (resistFingerprinting defaults to true before user
>> prefs are loaded, and resetting the timezone fails in some javascript
>> that expects /etc/localtime to be a symlink, see:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1817004#c8).
>
> But in icecat there is tow issues, one is related with the
> /etc/localtime that expect a symlink but also there is another one
> related with firefox sandbox, you can see here that `/usr` and `/nix`
> was added to a whitelist, those paths is where they expect have the
> zoneinfo files and `/gnu` is not in that whitelist (I already reported
> to firefox), and disabling `MOZ_DISABLE_CONTENT_SANDBOX=1` it and with
> the symlink the timezone works again.

In the meantime would you be able to produce a patch adding /gnu to
their allowlist? Then we'd have to look into the javascript code to see
if we can have it understand an actual file instead of symlink.

--
Thanks,
Maxim
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 68411@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68411
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch