[lxc-devel] [lxc/lxc] e55500: arguments: remove trailing slashes for the input l...

GitHub noreply at github.com
Tue Sep 24 14:37:40 UTC 2013


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: e555005b15a1d8e95997bd2d72abd0bc230a541d
      https://github.com/lxc/lxc/commit/e555005b15a1d8e95997bd2d72abd0bc230a541d
  Author: Qiang Huang <h.huangqiang at huawei.com>
  Date:   2013-09-24 (Tue, 24 Sep 2013)

  Changed paths:
    M src/lxc/arguments.c

  Log Message:
  -----------
  arguments: remove trailing slashes for the input lxcpath

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.huangqiang at huawei.com>
Acked-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


  Commit: 89cd77934835d1f04edd17c718d77591974e01f5
      https://github.com/lxc/lxc/commit/89cd77934835d1f04edd17c718d77591974e01f5
  Author: Qiang Huang <h.huangqiang at huawei.com>
  Date:   2013-09-24 (Tue, 24 Sep 2013)

  Changed paths:
    M src/lxc/lxccontainer.c
    M src/lxc/utils.c
    M src/lxc/utils.h

  Log Message:
  -----------
  utils: move remove_trailing_slashes to utils

Signed-off-by: Qiang Huang <h.huangqiang at huawei.com>
Acked-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/9d0cda4f22f7...89cd77934835


More information about the lxc-devel mailing list