unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68411: Timezone not detected from /etc/localtime
@ 2024-01-12 22:41 Distopico
  2024-01-19  4:32 ` Maxim Cournoyer
  0 siblings, 1 reply; 4+ messages in thread
From: Distopico @ 2024-01-12 22:41 UTC (permalink / raw)
  To: 68411


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
- Open  https://webbrowsertools.com/timezone/ in the browser
- 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:
- https://github.com/NixOS/nixpkgs/issues/238025
- https://github.com/NixOS/nixpkgs/pull/238700

Footnotes:
[1]  https://github.com/unicode-org/icu/pull/2323

[2]  https://bugzilla.mozilla.org/show_bug.cgi?id=1848615

[3]  https://hg.mozilla.org/releases/mozilla-esr115/rev/d7948b142f43





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#68411: Timezone not detected from /etc/localtime
  2024-01-12 22:41 bug#68411: Timezone not detected from /etc/localtime Distopico
@ 2024-01-19  4:32 ` Maxim Cournoyer
  2024-01-24 15:00   ` Distopico
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Cournoyer @ 2024-01-19  4:32 UTC (permalink / raw)
  To: Distopico; +Cc: 68411

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).

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#68411: Timezone not detected from /etc/localtime
  2024-01-19  4:32 ` Maxim Cournoyer
@ 2024-01-24 15:00   ` Distopico
  2024-01-24 19:14     ` Maxim Cournoyer
  0 siblings, 1 reply; 4+ messages in thread
From: Distopico @ 2024-01-24 15:00 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 68411

[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]


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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#68411: Timezone not detected from /etc/localtime
  2024-01-24 15:00   ` Distopico
@ 2024-01-24 19:14     ` Maxim Cournoyer
  0 siblings, 0 replies; 4+ messages in thread
From: Maxim Cournoyer @ 2024-01-24 19:14 UTC (permalink / raw)
  To: Distopico; +Cc: 68411

Hello,

Distopico <distopico@riseup.net> writes:

> 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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-24 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-12 22:41 bug#68411: Timezone not detected from /etc/localtime Distopico
2024-01-19  4:32 ` Maxim Cournoyer
2024-01-24 15:00   ` Distopico
2024-01-24 19:14     ` Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).