]> 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:34 +0000 (10:57 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 27 Aug 2015 21:50:21 +0000 (17:50 -0400)
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index 1d1cfb2ed446bb6d4c826a5d21d002187a8b37c4..e1b8a6ce8a07b7053f50f4a156d509708ab7b22a 100644 (file)
@@ -4094,12 +4094,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;
                }
@@ -4162,7 +4162,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;