Ubuntu

user dir binding breaks on nonexistent user

Reported by Serge Hallyn on 2011-10-20
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Low
Unassigned
Oneiric
Undecided
Unassigned

Bug Description

When creating a container with the '-b user' option to the ubuntu template, if 'user' does not exist, the resulting container will have a bad fstab causing the container to fail to start. The last line in /var/lib/lxc/<container>/fstab then reads:

 /var/lib/lxc/test2/rootfs/ none bind 0 0

the template should raise an error if 'user' does not exist.

===========================
SRU Justification
1. Impact: containers creation can appear to have succeeded, with only
an easy to miss warning that user binding failed. But lxc-start will
fail due to a bad container fstab entry.
2. Development fix: a small patch to the ubuntu template catches the
bad user name early on.
3. Stable Fix: same as development fix.
4. Test case:
   lxc-create -f /etc/lxc.conf -t ubuntu -n l1 -- -b xyz
   lxc-start -n l1
where xyz is not a valid user. Creation will appear to succeed, but the
container will fail to start.
5. Regression potential:
   If there is an error in the patch, it could cause problems with
   ubuntu container creations.
===========================

Serge Hallyn (serge-hallyn) wrote :

Calling this low priority because there is an obvious workaround ("don't do that").

However since there is absolutely no hint for the casual user as to what went wrong, I think it's important to get this SRUd anyway.

Changed in lxc (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-0ubuntu9

---------------
lxc (0.7.5-0ubuntu9) precise; urgency=low

  * debian/patches/0008-fix-bindhome-in-template.patch: fix a bug in the
    ubuntu template: if the user specified with -b does not exist, a bad
    container fstab was created, so that, with no warning or indication of
    why, the container failed to start. (LP: #879052)
 -- Serge Hallyn <email address hidden> Thu, 20 Oct 2011 14:51:37 -0500

Changed in lxc (Ubuntu):
status: Confirmed → Fix Released
description: updated

Hello Serge, or anyone else affected,

Accepted lxc into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in lxc (Ubuntu Oneiric):
status: New → Fix Committed
tags: added: verification-needed
xlyz (xlyz) wrote :

tested and now works as expected.

if a non-existing user is used, the creation is aborted (with a message). if the user exists, or no user is declared, container is created as usual.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-0ubuntu8.1

---------------
lxc (0.7.5-0ubuntu8.1) oneiric-proposed; urgency=low

  * debian/patches/0008-fix-bindhome-in-template.patch: fix a bug in the
    ubuntu template: if the user specified with -b does not exist, a bad
    container fstab was created, so that, with no warning or indication of
    why, the container failed to start. (LP: #879052)
 -- Serge Hallyn <email address hidden> Thu, 20 Oct 2011 14:51:37 -0500

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

Other bug subscribers