Extracts with the wrong gid

Bug #1408579 reported by Michael Vogt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-core-upgrader (Ubuntu)
In Progress
High
Unassigned

Bug Description

Upgrading the i386 image results in incorrect permissions for /usr/lib/dbus-1.0/dbus-daemon-launch-helper (the gid is 107 instead of 103). The reason is that on the i386 image the /etc/group gids have changed. They are static now but the problem is still there that the gid is wrong. It turns out the reason is that the old group file has gid 107, but when the upgrade is applied the python extract code is doing:
"""
    def chown(self, tarinfo, targetpath):
        """Set owner of targetpath according to tarinfo.
        """
        if pwd and hasattr(os, "geteuid") and os.geteuid() == 0:
            # We have to be root to do so.
            try:
                g = grp.getgrnam(tarinfo.gname)[2]
            except KeyError:
                g = tarinfo.gid
"""
which means that if the group file changes with the update the extracted gid will be wrong and uses the old gid instead of the new gid. This happens currently only on the i386 upgrader from the ubuntu-core/devel image to the devel-proposed image.

A possible fix is to not use the python tar file for the extraction but instead use "tar --numeric-owner"

But this still does not fix images with the broken upgrader. A fix to fix that could be:
1. fix upgrader
2. promote amd64 image with the fixed upgrader
3. change gid of messagebus to match i386 gid
4a. upgrades for amd64 will work because it has a fixed upgrader
4b. upgrades for i386 will work because the gid is the same as before

Tags: patch
Revision history for this message
Michael Vogt (mvo) wrote :

The use of subprocess.call(["tar", "--numeric-owner"...]) might be impractical due to the need for the tar_generator() - therefor I attached a patch that simply patches gtp.getgrpnam to force the gid usage.

Michael Vogt (mvo)
Changed in ubuntu-core-upgrader (Ubuntu):
importance: Undecided → High
status: New → In Progress
tags: added: patch
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.