]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: Fix print_top_failing_dir for /var/lib/lxc
authorStéphane Graber <stgraber@ubuntu.com>
Thu, 27 Feb 2014 22:32:39 +0000 (17:32 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 27 Feb 2014 22:47:25 +0000 (17:47 -0500)
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: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/start.c

index f44be963c87092bac79b16d52bee32cbb5cbbba4..fe3d09335b2a0c6cff10c374c13548a438865312 100644 (file)
@@ -94,8 +94,6 @@ static void print_top_failing_dir(const char *path)
        while (p < e) {
                while (p < e && *p == '/') p++;
                while (p < e && *p != '/') p++;
-               if (p >= e)
-                       return;
                saved = *p;
                *p = '\0';
                if (access(copy, X_OK)) {
@@ -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);
                goto out_warn_father;
        }