user dir binding breaks on nonexistent user
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/
the template should raise an error if 'user' does not exist.
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.