]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Merge pull request #2008 from tych0/share-ns-in-execute
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 14 Dec 2017 20:37:41 +0000 (21:37 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Dec 2017 20:37:41 +0000 (21:37 +0100)
add --share-$NS= support to lxc-execute

1  2 
src/lxc/tools/lxc_execute.c

index 7a94cc4bb8739d9c4b4ca7548d4533baa2023a16,4b4120030a75288e2b7d464c643f6d2e9e53d809..c252236827148cccd4d25052f66110e6c8dad43d
@@@ -189,12 -191,14 +197,17 @@@ int main(int argc, char *argv[]
        if (my_args.gid)
                c->lxc_conf->init_gid = my_args.gid;
  
+       if (!lxc_setup_shared_ns(&my_args, c)) {
+               lxc_container_put(c);
+               exit(EXIT_FAILURE);
+       }
        c->daemonize = my_args.daemonize == 1;
        bret = c->start(c, 1, my_args.argv);
 -      ret = c->error_num;
 +      if (c->daemonize)
 +              ret = EXIT_SUCCESS;
 +      else
 +              ret = c->error_num;
        lxc_container_put(c);
        if (!bret) {
                fprintf(stderr, "Failed run an application inside container\n");