]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: set configfile after load_config
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 12 Aug 2016 12:49:37 +0000 (14:49 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 17 Aug 2016 14:27:23 +0000 (16:27 +0200)
In order to cause c->is_defined() to become true.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
13 files changed:
src/lxc/tools/lxc_attach.c
src/lxc/tools/lxc_cgroup.c
src/lxc/tools/lxc_checkpoint.c
src/lxc/tools/lxc_console.c
src/lxc/tools/lxc_copy.c
src/lxc/tools/lxc_destroy.c
src/lxc/tools/lxc_device.c
src/lxc/tools/lxc_freeze.c
src/lxc/tools/lxc_info.c
src/lxc/tools/lxc_snapshot.c
src/lxc/tools/lxc_stop.c
src/lxc/tools/lxc_unfreeze.c
src/lxc/tools/lxc_wait.c

index 281f97aca0fcee784acaa53aa602c708ea8a2ccd..9d7138835777ab752fac10b93637695ce291987a 100644 (file)
@@ -385,6 +385,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        exit(EXIT_FAILURE);
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       ERROR("Out of memory setting new config filename");
+                       lxc_container_put(c);
+                       exit(EXIT_FAILURE);
+               }
        }
 
        if (!c->may_control(c)) {
index c644501735eb0a917ee7a255677c19adbf5be143..4dc2682b8a52668ac1c375ffa15048dcdce4fbf3 100644 (file)
@@ -92,6 +92,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        return 1;
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       ERROR("Out of memory setting new config filename");
+                       lxc_container_put(c);
+                       return 1;
+               }
        }
 
        if (!c->may_control(c)) {
index bc18b80c98da44880e0b9d158121a02ef3c210b0..6de3d239ba4fbb538d041b8ecd45f16bc2acd529 100644 (file)
@@ -222,6 +222,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        exit(1);
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       lxc_container_put(c);
+                       exit(1);
+               }
        }
 
        if (!c->may_control(c)) {
index 8a4d1c0f9c1c8d53cb463c447b11ade9f4c85eb4..829c908d47e293f6dde6db4b140a9e060203c1c6 100644 (file)
@@ -120,6 +120,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        exit(EXIT_FAILURE);
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       lxc_container_put(c);
+                       exit(EXIT_FAILURE);
+               }
        }
 
        if (!c->may_control(c)) {
index c81c0777066cdf5660c51e4812165102d7d45316..f7dc8b29dcebe9b43f27ab3203b55d5fed843e9d 100644 (file)
@@ -217,6 +217,11 @@ int main(int argc, char *argv[])
                        fprintf(stderr, "Failed to load rcfile\n");
                        goto out;
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       goto out;
+               }
        }
 
        if (!c->may_control(c)) {
index 50fd708a1de039b825f193adf1e6a1bd8d2d0317..3f46415df8537135cc7735f3b0b7da00017fa756 100644 (file)
@@ -96,6 +96,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        exit(EXIT_FAILURE);
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       lxc_container_put(c);
+                       exit(EXIT_FAILURE);
+               }
        }
 
        if (!c->may_control(c)) {
index 0f1ee8b15a52143dc0baabbfdcea9cca83b6bebf..49af062e552e37e37f204c306937bf2d350fbf1c 100644 (file)
@@ -132,6 +132,11 @@ int main(int argc, char *argv[])
                        ERROR("Failed to load rcfile");
                        goto err1;
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       ERROR("Out of memory setting new config filename");
+                       goto err1;
+               }
        }
 
        if (!c->is_running(c)) {
index d0239bfea031af900bbe4efceb27fedd1f2f66b0..ac0802e5a7abc9962f750ef485731849f67df779 100644 (file)
@@ -82,6 +82,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        exit(1);
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       ERROR("Out of memory setting new config filename");
+                       lxc_container_put(c);
+                       exit(1);
+               }
        }
 
        if (!c->may_control(c)) {
index e83369707959c6dbe779bffd6d01bf903bc05a12..08c698d618d5e6ab432262a4384e51d2caa132c6 100644 (file)
@@ -303,6 +303,12 @@ static int print_info(const char *name, const char *lxcpath)
                        lxc_container_put(c);
                        return -1;
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       lxc_container_put(c);
+                       return -1;
+               }
        }
 
        if (!c->may_control(c)) {
index aa9b6fec1c93a311972f5af625fa2cdca2b458df..a1166bcbc43f7248c7d8100b400dc3d615cd9b93 100644 (file)
@@ -115,6 +115,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        exit(EXIT_FAILURE);
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       lxc_container_put(c);
+                       exit(EXIT_FAILURE);
+               }
        }
 
        if (!c->may_control(c)) {
index bbe1f1c616f881dd8ac86e8e27cc1c7fad4a7ba9..cb7cfe2e6013cb437e4aff61f8611c5cebca6ff9 100644 (file)
@@ -210,6 +210,11 @@ int main(int argc, char *argv[])
                        fprintf(stderr, "Failed to load rcfile\n");
                        goto out;
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       goto out;
+               }
        }
 
        if (!c->may_control(c)) {
index b7bbea6866079f96acf3eb1b812e8c41ce758722..24faf5e96b77bc0d088c079394f92443cedae0dc 100644 (file)
@@ -86,6 +86,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        exit(1);
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       ERROR("Out of memory setting new config filename");
+                       lxc_container_put(c);
+                       exit(1);
+               }
        }
 
        if (!c->unfreeze(c)) {
index deeff984b5e34f619b28658d4d73ffb29ee6820c..61fd869d7065d2dc10439d2b109442051b8b2e0b 100644 (file)
@@ -112,6 +112,12 @@ int main(int argc, char *argv[])
                        lxc_container_put(c);
                        return 1;
                }
+               c->configfile = strdup(my_args.rcfile);
+               if (!c->configfile) {
+                       fprintf(stderr, "Out of memory setting new config filename\n");
+                       lxc_container_put(c);
+                       return 1;
+               }
        }
 
        if (!c->wait(c, my_args.states, my_args.timeout)) {