system-tools-backends puts a regular file in /etc/localtime instead of updating the symlink, breaks snap packages

Bug #2007806 reported by Tim Starling
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
system-tools-backends (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

When system-tools-backends updates the current timezone, it deletes /etc/localtime and copies the new zone info as a regular file.

sub set_timezone
{
    ...
    unlink $localtime; # Important, since it might be a symlink.

    &Utils::Report::enter ();
    $res = copy ($tz, $localtime);
    &Utils::Report::leave ();

This contradicts localtime(5) which states that /etc/localtime should be a symlink. It breaks Firefox as I reported at https://bugzilla.mozilla.org/show_bug.cgi?id=1817701 , and probably all other snap packages that depend on an old libc.

Tags: patch
Revision history for this message
Tim Starling (tstarling) wrote :

I tested the attached patch by building the package and installing it locally.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "08_localtime-symlink.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the patch

Changed in system-tools-backends (Ubuntu):
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package system-tools-backends - 2.10.2-3.1ubuntu1

---------------
system-tools-backends (2.10.2-3.1ubuntu1) lunar; urgency=medium

  * debian/patches/08_localtime_symlink.patch:
    - update /etc/localtime by creating a symlink, the upstream documentation
      states it shouldn't a file, which also fixes incorrect timezones
      informations being displayed in the firefox snap.
      Thanks Tim Starling for the patch (lp: #2007806)

 -- Sebastien Bacher <email address hidden> Thu, 09 Mar 2023 15:27:16 +0100

Changed in system-tools-backends (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.