The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2890

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
After the change, `lxcbasename()` would avoid slash character at the head of the string.
The return value of the `lxcbasename()` is put in the `newargv` variable, and this variable is used in `execvp`.

https://github.com/lxc/lxc/blob/9fc7a50f8a7f1066f658bcb5bab5f3d724318827/src/lxc/lxccontainer.c#L1448

https://github.com/lxc/lxc/blob/9fc7a50f8a7f1066f658bcb5bab5f3d724318827/src/lxc/lxccontainer.c#L1629.
From 9daafec9c91ba0039b7c0b4e472527974fb87779 Mon Sep 17 00:00:00 2001
From: knknkn1162 <[email protected]>
Date: Sun, 3 Mar 2019 22:03:35 +0900
Subject: [PATCH] fix lxcbasename in lxc/lxccontainer.c

---
 src/lxc/lxccontainer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index 683bf5f43e..317454b127 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -1322,7 +1322,7 @@ static char *lxcbasename(char *path)
        while (*p != '/' && p > path)
                p--;
 
-       return p;
+       return (p == path) ? p : ++p;
 }
 
 static bool create_run_template(struct lxc_container *c, char *tpath,
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to