diff options
author | Ben Pfaff <blp@nicira.com> | 2011-02-28 15:43:29 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-03-10 11:23:59 -0800 |
commit | d198c4beee03741670d046baf0179ac5583305bb (patch) | |
tree | 334e1bdaeb58f1f63797a711d0f01e9c22f81c15 /lib/ovsdb-data.c | |
parent | acb4f876b8cdf37191355724da8f4aca64c9bfae (diff) | |
download | openvswitch-d198c4beee03741670d046baf0179ac5583305bb.tar.gz |
ovsdb-data: Verify that named-uuid string is an <id>.
The "uuid-name" that creates symbols must be an <id> but we weren't
verifying the same constraint on the "named-uuid"s that refer to symbols,
which was a bit confusing in writing transactions by hand. This commit
fixes the inconsistency and updates the SPECS file to clarify that a
named-uuid string has to be an <id>.
Diffstat (limited to 'lib/ovsdb-data.c')
-rw-r--r-- | lib/ovsdb-data.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c index c373be9a9..1a0752447 100644 --- a/lib/ovsdb-data.c +++ b/lib/ovsdb-data.c @@ -26,6 +26,7 @@ #include "dynamic-string.h" #include "hash.h" #include "ovsdb-error.h" +#include "ovsdb-parser.h" #include "json.h" #include "shash.h" #include "sort.h" @@ -307,6 +308,10 @@ ovsdb_atom_parse_uuid(struct uuid *uuid, const struct json *json, ovsdb_error_destroy(error0); *uuid = ovsdb_symbol_table_insert(symtab, name)->uuid; + if (!ovsdb_parser_is_id(json_string(value))) { + return ovsdb_syntax_error(json, NULL, "named-uuid string is " + "not a valid <id>"); + } return NULL; } ovsdb_error_destroy(error1); |