diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index a648c6d..082296a 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -44,6 +44,7 @@ #include "viralloc.h" #include "virfile.h" #include "virstring.h" +#include "virlog.h" #define VIR_FROM_THIS VIR_FROM_STORAGE @@ -785,7 +786,8 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, perms->uid = (uid_t) -1; } else { if (virXPathLong("number(./owner)", ctxt, &val) < 0 || - (uid_t)val != val) { + ((uid_t)val != val && + val != -1)) { virReportError(VIR_ERR_XML_ERROR, "%s", _("malformed owner element")); goto error; @@ -798,7 +800,8 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, perms->gid = (gid_t) -1; } else { if (virXPathLong("number(./group)", ctxt, &val) < 0 || - (gid_t)val != val) { + ((gid_t) val != val && + val != -1)) { virReportError(VIR_ERR_XML_ERROR, "%s", _("malformed group element")); goto error;