]> git.ipfire.org Git - thirdparty/lxc.git/commit
usernsexec: Make err out vebose for unshare error 2532/head
authorTobin C. Harding <me@tobin.cc>
Wed, 15 Aug 2018 23:43:02 +0000 (09:43 +1000)
committerTobin C. Harding <me@tobin.cc>
Thu, 16 Aug 2018 06:44:12 +0000 (16:44 +1000)
commitede912b440c579da4653ac9ded6d292b80e19f06
treecef86cb6653243cdb4873bdfe2b92a9eea261e2d
parent03eda5655142c838085d93aed7ad142676118ad0
usernsexec: Make err out vebose for unshare error

Currently if lxc-usernsexec is run on a kernel without user namespaces
enabled the error message is

unshare: Invalid argument
read pipe: Success

This error message 'Invalid argument' does not point at the root cause
of the error.  We can help the user out by giving a more detailed error
message and also not using perror() if errno==0.

Improve error message by
 - Printing unshare flags
 - Printing suggested cause of failure (user namespace not enabled)
 - Print error message with fprintf() if errno==0 (EOF)

Signed-off-by: Tobin C. Harding <me@tobin.cc>
src/lxc/cmd/lxc_usernsexec.c