diff options
Diffstat (limited to 'recipes-containers/lxc/files/open_without_symlink-Account-when-prefix-is-empty-st.patch')
-rw-r--r-- | recipes-containers/lxc/files/open_without_symlink-Account-when-prefix-is-empty-st.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/open_without_symlink-Account-when-prefix-is-empty-st.patch b/recipes-containers/lxc/files/open_without_symlink-Account-when-prefix-is-empty-st.patch new file mode 100644 index 00000000..28f9889b --- /dev/null +++ b/recipes-containers/lxc/files/open_without_symlink-Account-when-prefix-is-empty-st.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 01074e5b34719537cef474c6b81d4f55e6427639 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bogdan Purcareata <bogdan.purcareata@nxp.com> | ||
3 | Date: Fri, 8 Jan 2016 15:38:35 +0000 | ||
4 | Subject: [PATCH] open_without_symlink: Account when prefix is empty string | ||
5 | |||
6 | In the current implementation, the open_without_symlink function | ||
7 | will default to opening the root mount only if the passed rootfs | ||
8 | prefix is null. It doesn't account for the case where this prefix | ||
9 | is passed as an empty string. | ||
10 | |||
11 | Properly handle this second case as well. | ||
12 | |||
13 | Upstream-Status: Accepted | ||
14 | [https://github.com/lxc/lxc/commit/01074e5b34719537cef474c6b81d4f55e6427639] | ||
15 | |||
16 | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> | ||
17 | Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> | ||
18 | --- | ||
19 | src/lxc/utils.c | 2 +- | ||
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/src/lxc/utils.c b/src/lxc/utils.c | ||
23 | index ed8c4c4..4e96a50 100644 | ||
24 | --- a/src/lxc/utils.c | ||
25 | +++ b/src/lxc/utils.c | ||
26 | @@ -1575,7 +1575,7 @@ static int open_without_symlink(const char *target, const char *prefix_skip) | ||
27 | fulllen = strlen(target); | ||
28 | |||
29 | /* make sure prefix-skip makes sense */ | ||
30 | - if (prefix_skip) { | ||
31 | + if (prefix_skip && strlen(prefix_skip) > 0) { | ||
32 | curlen = strlen(prefix_skip); | ||
33 | if (!is_subdir(target, prefix_skip, curlen)) { | ||
34 | ERROR("WHOA there - target '%s' didn't start with prefix '%s'", | ||
35 | -- | ||
36 | 1.9.1 | ||
37 | |||