diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 1b4d4cf85e2ce69f27c3798765db4136c2d16c8b..8f04b7839295a69d60091ca4b96cf890050b359a 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -671,8 +671,13 @@ virStorageFileMatchesVersion(int format, static bool virBackingStoreIsFile(const char *backing) { - /* Backing store is a network block device or Rados block device */ - if (STRPREFIX(backing, "nbd:") || STRPREFIX(backing, "rbd:")) + char *colon = strchr(backing, ':'); + char *slash = strchr(backing, '/'); + + /* Reject anything that looks like a protocol (such as nbd: or + * rbd:); if someone really does want a relative file name that + * includes ':', they can always prefix './'. */ + if (colon && (!slash || colon < slash)) return false; return true; }