Commit 99b71824 by Stéphane Graber

start: Fix print_top_failing_dir for /var/lib/lxc

In the case where /var/lib/lxc itself was not accessible, print_top_failing_dir would fail to print the error message. This fixes it and also change the initial access check for X_OK instead of R_OK (to match what we actually need and print_top_failing_dir's own check). Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent fda03e44
...@@ -94,8 +94,6 @@ static void print_top_failing_dir(const char *path) ...@@ -94,8 +94,6 @@ static void print_top_failing_dir(const char *path)
while (p < e) { while (p < e) {
while (p < e && *p == '/') p++; while (p < e && *p == '/') p++;
while (p < e && *p != '/') p++; while (p < e && *p != '/') p++;
if (p >= e)
return;
saved = *p; saved = *p;
*p = '\0'; *p = '\0';
if (access(copy, X_OK)) { if (access(copy, X_OK)) {
...@@ -666,7 +664,7 @@ static int do_start(void *data) ...@@ -666,7 +664,7 @@ static int do_start(void *data)
} }
} }
if (access(handler->lxcpath, R_OK)) { if (access(handler->lxcpath, X_OK)) {
print_top_failing_dir(handler->lxcpath); print_top_failing_dir(handler->lxcpath);
goto out_warn_father; goto out_warn_father;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment