From: LiFeng Date: Mon, 20 Nov 2017 11:42:30 +0000 (-0500) Subject: Fix namespace config parse error X-Git-Tag: lxc-3.0.0.beta1~181^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=716495668b9fc02fabee48fe2a24c70b88a8226b;p=thirdparty%2Flxc.git Fix namespace config parse error Signed-off-by: LiFeng --- diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c index 3d843ba77..d86a2d88e 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -759,8 +759,8 @@ int lxc_inherit_namespace(const char *lxcname_or_pid, const char *lxcpath, if (!dup) return -ENOMEM; - *lastslash = '\0'; - pid = lxc_container_name_to_pid(lastslash, dup); + dup[lastslash - lxcname_or_pid] = '\0'; + pid = lxc_container_name_to_pid(lastslash + 1, dup); free(dup); } else { pid = lxc_container_name_to_pid(lxcname_or_pid, lxcpath);