Permissions mangled when creating rootfs from cloud images
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
High
|
Serge Hallyn | ||
Precise |
Fix Released
|
High
|
Unassigned | ||
Quantal |
Fix Released
|
High
|
Unassigned | ||
Raring |
Fix Released
|
High
|
Serge Hallyn |
Bug Description
=======
1. Impact: cloud image creations can fail. This causes juju with local provider to fail.
2. Development fix: use --numeric-owner when un-tarring ubuntu images, to make sure that /home/ubuntu in the container is owned by the right ubuntu userid.
3. Stable fix: same as the development fix
4. Test case:
1. add an ubuntu user if one does not yet exist on the host - make sure it is not uid 1000
2. lxc-create -t ubuntu-cloud -n c1 -- -r precise
3. check /home/ubuntu in the container - it will be owned by the ubuntu userid on the host.
Additionally, when starting c1, you will be unable to log in as user ubuntu.
5. Regression potential: this should introduce no regressions, as it only makes sure that the owners of files in the container match the username-userid mapping in the container's password file.
=======
Permissions on the created lxc container somehow are reflecting the users /etc/password file:
ubuntu@
landscape:
ubuntu@
total 12
drwxr-xr-x 2 root root 4096 Oct 12 17:48 ./
drwxr-xr-x 86 root root 4096 Oct 12 17:47 ../
-rw------- 1 999 root 164 Oct 12 17:48 client.conf
ubuntu@
Connection to 10.0.3.143 closed.
dpb@starbuck:
landscape:
dpb@starbuck:
My hunch is where the tar happens from the mount of the downloaded image in lxc/templates/
Related branches
- Serge Hallyn: Approve
- Ubuntu branches: Pending requested
-
Diff: 70 lines (+30/-1)5 files modified.pc/applied-patches (+1/-0)
debian/changelog (+7/-0)
debian/patches/0225-ubuntu-cloud-numeric-owner (+20/-0)
debian/patches/series (+1/-0)
templates/lxc-ubuntu-cloud.in (+1/-1)
Changed in lxc (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in lxc (Ubuntu Quantal): | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in lxc (Ubuntu Precise): | |
importance: | Undecided → High |
status: | New → Triaged |
description: | updated |
tags: |
added: verification-done-precise removed: verification-needed-precise |
Changed in lxc (Ubuntu Raring): | |
assignee: | nobody → Serge Hallyn (serge-hallyn) |
The following fixes the problem:
dpb@starbuck: templates$ pwd lxc/templates templates$ diff *.orig lxc-ubuntu-cloud
/usr/share/
dpb@starbuck:
344c344
< tar -zxf $cache/$filename
---
> tar --numeric-owner -zxf $cache/$filename