From acf9f89e61caadbc614107773a2fa14d8f3458ea Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Mon, 14 Jul 2014 13:22:53 -0500 Subject: [PATCH] rootfs_is_blockdev: don't run if no rootfs is specified Signed-off-by: Serge Hallyn --- src/lxc/bdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 9d29e3e1a..fad284596 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -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;