oracle template: further disable selinux in ol5 container

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
oracle template: prevent mingetty from calling vhangup(2)

This is needed when using the user namespace since the kernel check does
not allow user_ns root to successfully call vhangup(2), and mingetty will
quit in this case.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
oracle template: don't clear console tty

This allows the boot messages to be seen which are useful for monitoring
container startup.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
oracle template: fix pam login failures under user namespace

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
fix memory leaks reported by cppcheck in src/lxc/conf.c (v2)

This also fixes possible crashes due to passing NULL to strlen function

Changes since v1;
* Fixed a typo spotted by Serge

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxc_user_nic: add a check to make sure caller owns target netns

Temporarily set our euid back to the calling ruid, so that the
access(2) check can succeed based on the euid being the userns
creator.

Also switch from atoi to strtol

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: don't pass unused arg to get_username()

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: report strerror(errno)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: only exit from main and usage

Everywhere else return an error code instead.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: report failing filename in open_and_lock error cases

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: fix get_allotted description.

get_allotted doesn't get the list of nic names, only the # of nics
allowed to the user.  We check the db_file later for existing
number of nics.

Also close the conf file on success, and print filename and errno
if we failed to open conf file.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: make all fns static for consistency

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: initialize cnic to NULL to please compiler

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-user-nic: improve cull_entries

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_user_nic: fix fd leak reported by coverity

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>