ovsdb: Require database, table, column names to be valid identifiers.
[cascardo/ovs.git] / ovsdb / table.c
index d017a6b..b520580 100644 (file)
@@ -111,6 +111,8 @@ ovsdb_table_schema_from_json(const struct json *json, const char *name,
         if (node->name[0] == '_') {
             error = ovsdb_syntax_error(json, NULL, "names beginning with "
                                        "\"_\" are reserved");
+        } else if (!ovsdb_parser_is_id(node->name)) {
+            error = ovsdb_syntax_error(json, NULL, "name must be a valid id");
         } else {
             error = ovsdb_column_from_json(node->data, node->name, &column);
         }