Extracts with the wrong gid
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/
"""
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(
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
Changed in ubuntu-core-upgrader (Ubuntu): | |
importance: | Undecided → High |
status: | New → In Progress |
tags: | added: patch |
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.