lxc_user_nic: add a check to make sure caller owns target netns

Also switch from atoi to strtol

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

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxc_user_nic: report strerror(errno)

Signed-off-by: Serge Hallyn <serge.hallyn@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>
lxc_user_nic: report failing filename in open_and_lock error cases

Signed-off-by: Serge Hallyn <serge.hallyn@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>
lxc_user_nic: make all fns static for consistency

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxc_user_nic: initialize cnic to NULL to please compiler

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