It segfaults otherwise, trying to execute &NULL. (i.e. lxc-unshare -s MOUNT)
Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com> --- src/lxc/lxc_unshare.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_unshare.c b/src/lxc/lxc_unshare.c index 0baccb0..5f342f2 100644 --- a/src/lxc/lxc_unshare.c +++ b/src/lxc/lxc_unshare.c @@ -44,12 +44,11 @@ lxc_log_define(lxc_unshare_ui, lxc); void usage(char *cmd) { - fprintf(stderr, "%s <options> [command]\n", basename(cmd)); + fprintf(stderr, "%s <options> command [command_arguments]\n", basename(cmd)); fprintf(stderr, "Options are:\n"); fprintf(stderr, "\t -s flags: ORed list of flags to unshare:\n" \ "\t MOUNT, PID, UTSNAME, IPC, USER, NETWORK\n"); fprintf(stderr, "\t -u <id> : new id to be set if -s USER is specified\n"); - fprintf(stderr, "\t if -s PID is specified, <command> is mandatory)\n"); _exit(1); } @@ -184,6 +183,11 @@ int main(int argc, char *argv[]) } } + if (argv[optind] == NULL) { + ERROR("a command to execute in the new namespace is required"); + return 1; + } + args = &argv[optind]; ret = lxc_caps_init(); -- 1.7.9.5 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel