]> git.proxmox.com Git - lxc.git/blame - debian/patches/0002-tools-set-configfile-after-load_config.patch
buildsys: use the ARCH variable for package names
[lxc.git] / debian / patches / 0002-tools-set-configfile-after-load_config.patch
CommitLineData
d2cfdb36
WB
1From fb259e5b431260c61a2afcee862f7e836d7d8cf9 Mon Sep 17 00:00:00 2001
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Fri, 12 Aug 2016 14:49:37 +0200
4Subject: [PATCH 2/3] tools: set configfile after load_config
5
6In order to cause c->is_defined() to become true.
7
8Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9---
10 src/lxc/tools/lxc_attach.c | 6 ++++++
11 src/lxc/tools/lxc_cgroup.c | 6 ++++++
12 src/lxc/tools/lxc_checkpoint.c | 6 ++++++
13 src/lxc/tools/lxc_console.c | 6 ++++++
14 src/lxc/tools/lxc_copy.c | 5 +++++
15 src/lxc/tools/lxc_destroy.c | 6 ++++++
16 src/lxc/tools/lxc_device.c | 5 +++++
17 src/lxc/tools/lxc_freeze.c | 6 ++++++
18 src/lxc/tools/lxc_info.c | 6 ++++++
19 src/lxc/tools/lxc_snapshot.c | 6 ++++++
20 src/lxc/tools/lxc_stop.c | 5 +++++
21 src/lxc/tools/lxc_unfreeze.c | 6 ++++++
22 src/lxc/tools/lxc_wait.c | 6 ++++++
23 13 files changed, 75 insertions(+)
24
25diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c
26index 14c724a..e436ae9 100644
27--- a/src/lxc/tools/lxc_attach.c
28+++ b/src/lxc/tools/lxc_attach.c
29@@ -384,6 +384,12 @@ int main(int argc, char *argv[])
30 lxc_container_put(c);
31 exit(EXIT_FAILURE);
32 }
33+ c->configfile = strdup(my_args.rcfile);
34+ if (!c->configfile) {
35+ ERROR("Out of memory setting new config filename");
36+ lxc_container_put(c);
37+ exit(EXIT_FAILURE);
38+ }
39 }
40
41 if (!c->may_control(c)) {
42diff --git a/src/lxc/tools/lxc_cgroup.c b/src/lxc/tools/lxc_cgroup.c
43index c644501..4dc2682 100644
44--- a/src/lxc/tools/lxc_cgroup.c
45+++ b/src/lxc/tools/lxc_cgroup.c
46@@ -92,6 +92,12 @@ int main(int argc, char *argv[])
47 lxc_container_put(c);
48 return 1;
49 }
50+ c->configfile = strdup(my_args.rcfile);
51+ if (!c->configfile) {
52+ ERROR("Out of memory setting new config filename");
53+ lxc_container_put(c);
54+ return 1;
55+ }
56 }
57
58 if (!c->may_control(c)) {
59diff --git a/src/lxc/tools/lxc_checkpoint.c b/src/lxc/tools/lxc_checkpoint.c
60index bc18b80..6de3d23 100644
61--- a/src/lxc/tools/lxc_checkpoint.c
62+++ b/src/lxc/tools/lxc_checkpoint.c
63@@ -222,6 +222,12 @@ int main(int argc, char *argv[])
64 lxc_container_put(c);
65 exit(1);
66 }
67+ c->configfile = strdup(my_args.rcfile);
68+ if (!c->configfile) {
69+ fprintf(stderr, "Out of memory setting new config filename\n");
70+ lxc_container_put(c);
71+ exit(1);
72+ }
73 }
74
75 if (!c->may_control(c)) {
76diff --git a/src/lxc/tools/lxc_console.c b/src/lxc/tools/lxc_console.c
77index 8a4d1c0..829c908 100644
78--- a/src/lxc/tools/lxc_console.c
79+++ b/src/lxc/tools/lxc_console.c
80@@ -120,6 +120,12 @@ int main(int argc, char *argv[])
81 lxc_container_put(c);
82 exit(EXIT_FAILURE);
83 }
84+ c->configfile = strdup(my_args.rcfile);
85+ if (!c->configfile) {
86+ fprintf(stderr, "Out of memory setting new config filename\n");
87+ lxc_container_put(c);
88+ exit(EXIT_FAILURE);
89+ }
90 }
91
92 if (!c->may_control(c)) {
93diff --git a/src/lxc/tools/lxc_copy.c b/src/lxc/tools/lxc_copy.c
94index c81c077..f7dc8b2 100644
95--- a/src/lxc/tools/lxc_copy.c
96+++ b/src/lxc/tools/lxc_copy.c
97@@ -217,6 +217,11 @@ int main(int argc, char *argv[])
98 fprintf(stderr, "Failed to load rcfile\n");
99 goto out;
100 }
101+ c->configfile = strdup(my_args.rcfile);
102+ if (!c->configfile) {
103+ fprintf(stderr, "Out of memory setting new config filename\n");
104+ goto out;
105+ }
106 }
107
108 if (!c->may_control(c)) {
109diff --git a/src/lxc/tools/lxc_destroy.c b/src/lxc/tools/lxc_destroy.c
110index 50fd708..3f46415 100644
111--- a/src/lxc/tools/lxc_destroy.c
112+++ b/src/lxc/tools/lxc_destroy.c
113@@ -96,6 +96,12 @@ int main(int argc, char *argv[])
114 lxc_container_put(c);
115 exit(EXIT_FAILURE);
116 }
117+ c->configfile = strdup(my_args.rcfile);
118+ if (!c->configfile) {
119+ fprintf(stderr, "Out of memory setting new config filename\n");
120+ lxc_container_put(c);
121+ exit(EXIT_FAILURE);
122+ }
123 }
124
125 if (!c->may_control(c)) {
126diff --git a/src/lxc/tools/lxc_device.c b/src/lxc/tools/lxc_device.c
127index 0f1ee8b..49af062 100644
128--- a/src/lxc/tools/lxc_device.c
129+++ b/src/lxc/tools/lxc_device.c
130@@ -132,6 +132,11 @@ int main(int argc, char *argv[])
131 ERROR("Failed to load rcfile");
132 goto err1;
133 }
134+ c->configfile = strdup(my_args.rcfile);
135+ if (!c->configfile) {
136+ ERROR("Out of memory setting new config filename");
137+ goto err1;
138+ }
139 }
140
141 if (!c->is_running(c)) {
142diff --git a/src/lxc/tools/lxc_freeze.c b/src/lxc/tools/lxc_freeze.c
143index d0239bf..ac0802e 100644
144--- a/src/lxc/tools/lxc_freeze.c
145+++ b/src/lxc/tools/lxc_freeze.c
146@@ -82,6 +82,12 @@ int main(int argc, char *argv[])
147 lxc_container_put(c);
148 exit(1);
149 }
150+ c->configfile = strdup(my_args.rcfile);
151+ if (!c->configfile) {
152+ ERROR("Out of memory setting new config filename");
153+ lxc_container_put(c);
154+ exit(1);
155+ }
156 }
157
158 if (!c->may_control(c)) {
159diff --git a/src/lxc/tools/lxc_info.c b/src/lxc/tools/lxc_info.c
160index e833697..08c698d 100644
161--- a/src/lxc/tools/lxc_info.c
162+++ b/src/lxc/tools/lxc_info.c
163@@ -303,6 +303,12 @@ static int print_info(const char *name, const char *lxcpath)
164 lxc_container_put(c);
165 return -1;
166 }
167+ c->configfile = strdup(my_args.rcfile);
168+ if (!c->configfile) {
169+ fprintf(stderr, "Out of memory setting new config filename\n");
170+ lxc_container_put(c);
171+ return -1;
172+ }
173 }
174
175 if (!c->may_control(c)) {
176diff --git a/src/lxc/tools/lxc_snapshot.c b/src/lxc/tools/lxc_snapshot.c
177index aa9b6fe..a1166bc 100644
178--- a/src/lxc/tools/lxc_snapshot.c
179+++ b/src/lxc/tools/lxc_snapshot.c
180@@ -115,6 +115,12 @@ int main(int argc, char *argv[])
181 lxc_container_put(c);
182 exit(EXIT_FAILURE);
183 }
184+ c->configfile = strdup(my_args.rcfile);
185+ if (!c->configfile) {
186+ fprintf(stderr, "Out of memory setting new config filename\n");
187+ lxc_container_put(c);
188+ exit(EXIT_FAILURE);
189+ }
190 }
191
192 if (!c->may_control(c)) {
193diff --git a/src/lxc/tools/lxc_stop.c b/src/lxc/tools/lxc_stop.c
194index bbe1f1c..cb7cfe2 100644
195--- a/src/lxc/tools/lxc_stop.c
196+++ b/src/lxc/tools/lxc_stop.c
197@@ -210,6 +210,11 @@ int main(int argc, char *argv[])
198 fprintf(stderr, "Failed to load rcfile\n");
199 goto out;
200 }
201+ c->configfile = strdup(my_args.rcfile);
202+ if (!c->configfile) {
203+ fprintf(stderr, "Out of memory setting new config filename\n");
204+ goto out;
205+ }
206 }
207
208 if (!c->may_control(c)) {
209diff --git a/src/lxc/tools/lxc_unfreeze.c b/src/lxc/tools/lxc_unfreeze.c
210index b7bbea6..24faf5e 100644
211--- a/src/lxc/tools/lxc_unfreeze.c
212+++ b/src/lxc/tools/lxc_unfreeze.c
213@@ -86,6 +86,12 @@ int main(int argc, char *argv[])
214 lxc_container_put(c);
215 exit(1);
216 }
217+ c->configfile = strdup(my_args.rcfile);
218+ if (!c->configfile) {
219+ ERROR("Out of memory setting new config filename");
220+ lxc_container_put(c);
221+ exit(1);
222+ }
223 }
224
225 if (!c->unfreeze(c)) {
226diff --git a/src/lxc/tools/lxc_wait.c b/src/lxc/tools/lxc_wait.c
227index deeff98..61fd869 100644
228--- a/src/lxc/tools/lxc_wait.c
229+++ b/src/lxc/tools/lxc_wait.c
230@@ -112,6 +112,12 @@ int main(int argc, char *argv[])
231 lxc_container_put(c);
232 return 1;
233 }
234+ c->configfile = strdup(my_args.rcfile);
235+ if (!c->configfile) {
236+ fprintf(stderr, "Out of memory setting new config filename\n");
237+ lxc_container_put(c);
238+ return 1;
239+ }
240 }
241
242 if (!c->wait(c, my_args.states, my_args.timeout)) {
243--
2442.1.4
245