]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix verification of start hook without a rootfs
authorDavid Ward <david.ward@ll.mit.edu>
Tue, 23 Jun 2015 14:57:20 +0000 (10:57 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 27 Aug 2015 21:37:20 +0000 (16:37 -0500)
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index d02dc83825ea54013403e8e7a94dfb479d270f64..3519f57ab1f9a12c87ac4218a7d0ca73d73c9f9b 100644 (file)
@@ -3639,12 +3639,12 @@ static bool verify_start_hooks(struct lxc_conf *conf)
                int ret;
 
                ret = snprintf(path, MAXPATHLEN, "%s%s",
-                       conf->rootfs.mount, hookname);
+                       conf->rootfs.path ? conf->rootfs.mount : "", hookname);
                if (ret < 0 || ret >= MAXPATHLEN)
                        return false;
                ret = stat(path, &st);
                if (ret) {
-                       SYSERROR("Start hook %s not found in container rootfs",
+                       SYSERROR("Start hook %s not found in container",
                                        hookname);
                        return false;
                }
@@ -3744,7 +3744,7 @@ int lxc_setup(struct lxc_handler *handler)
                return -1;
        }
 
-       /* Make sure any start hooks are in the rootfs */
+       /* Make sure any start hooks are in the container */
        if (!verify_start_hooks(lxc_conf))
                return -1;