+Mon Jun 22 12:27:39 CEST 2009 Daniel Veillard <veillard@redhat.com>
+
+ * src/conf.[ch]: restrict VMX syntax parsing types, patch by Matthias
+ Bolte
+
Mon Jun 22 12:14:48 CEST 2009 Daniel Veillard <veillard@redhat.com>
* src/storage_driver.c: cleanup when creating a storage pool fails,
if (str == NULL)
return(NULL);
} else if (CUR == '[') {
+ if (ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) {
+ virConfError(ctxt, VIR_ERR_CONF_SYNTAX,
+ _("lists not allowed in VMX format"));
+ return(NULL);
+ }
type = VIR_CONF_LIST;
NEXT;
SKIP_BLANKS_AND_EOL;
return(NULL);
}
} else if (c_isdigit(CUR) || (CUR == '-') || (CUR == '+')) {
+ if (ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) {
+ virConfError(ctxt, VIR_ERR_CONF_SYNTAX,
+ _("numbers not allowed in VMX format"));
+ return(NULL);
+ }
if (virConfParseLong(ctxt, &l) < 0) {
return(NULL);
}
}
while ((ctxt->cur < ctxt->end) &&
(c_isalnum(CUR) || (CUR == '_') ||
- ((ctxt->conf->flags & VIR_CONF_FLAG_ALLOW_VMX_NAMES) &&
+ ((ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) &&
((CUR == ':') || (CUR == '.')))))
NEXT;
ret = strndup(base, ctxt->cur - base);
} virConfType;
typedef enum {
- VIR_CONF_FLAG_ALLOW_VMX_NAMES = 1, /* allow : and . in names for compatibility
- with VMware VMX configuration file */
+ VIR_CONF_FLAG_VMX_FORMAT = 1, /* allow : and . in names for compatibility with
+ VMware VMX configuration file, but restrict
+ allowed value types to string only */
} virConfFlags;
static inline const char *