]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
rootfs_is_blockdev: don't run if no rootfs is specified
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 14 Jul 2014 18:22:53 +0000 (13:22 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 14 Jul 2014 18:23:38 +0000 (13:23 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/bdev.c

index 9d29e3e1a4eb41d75a0d5d96d53cf77a159f9d61..fad284596619ca832b04b79dce4e409c1acda1f0 100644 (file)
@@ -3123,6 +3123,10 @@ bool rootfs_is_blockdev(struct lxc_conf *conf)
        struct stat st;
        int ret;
 
+       if (!conf->rootfs.path || strcmp(conf->rootfs.path, "/") == 0 ||
+               strlen(conf->rootfs.path) == 0)
+               return false;
+
        ret = stat(conf->rootfs.path, &st);
        if (ret == 0 && S_ISBLK(st.st_mode))
                return true;