From 716495668b9fc02fabee48fe2a24c70b88a8226b Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 20 Nov 2017 06:42:30 -0500 Subject: [PATCH] Fix namespace config parse error Signed-off-by: LiFeng --- src/lxc/confile_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.47.2