Quoting Qiang Huang (h.huangqi...@huawei.com): > In lxc_cmd(), we use > snprintf(path, len, "%s/%s/command", lxcpath ? lxcpath : inpath, name); > to fill sock name, this assume lxcpath have no trailing slashes, so > if we use > lxc-info -n test -P /usr/local/var/lib/lxc_anon/ > to get a running container's state, we will get state: STOPPED which > is wrong, because we combine a wrong sock name. > > To fix this, just remove trailing slashes when parsing arguments. > > Signed-off-by: Qiang Huang <h.huangqi...@huawei.com>
Acked-by: Serge E. Hallyn <serge.hal...@ubuntu.com> > --- > src/lxc/arguments.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/lxc/arguments.c b/src/lxc/arguments.c > index c35dfd8..adcf8fe 100644 > --- a/src/lxc/arguments.c > +++ b/src/lxc/arguments.c > @@ -197,6 +197,7 @@ extern int lxc_arguments_parse(struct lxc_arguments *args, > case 'l': args->log_priority = optarg; break; > case 'q': args->quiet = 1; break; > case 'P': > + remove_trailing_slashes(optarg); > ret = lxc_arguments_lxcpath_add(args, optarg); > if (ret < 0) > return ret; > -- > 1.8.3 > ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel