diff options
author | Havoc Pennington <hp@redhat.com> | 2005-01-18 03:03:07 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2005-01-18 03:03:07 +0000 |
commit | 4fce285052c143296cd9e08a48de0175b5207853 (patch) | |
tree | f370d12f7ffe22898c1b3d6b85a35c2cb65ec88b /dbus | |
parent | cc63ef88a5f1f4f65d9003a6a0995001b883e891 (diff) |
2005-01-17 Havoc Pennington <hp@redhat.com>
* dbus/dbus-types.h: remove 16-bit types since we don't use them
ever
* dbus/dbus-marshal-validate.c (_dbus_validate_path): disallow any
"invalid name character" not only non-ASCII
* doc/dbus-specification.xml: further update spec, message bus
parts are still out-of-date but the marshaling etc. stuff is now
accurate-ish
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-marshal-validate.c | 40 | ||||
-rw-r--r-- | dbus/dbus-types.h | 2 |
2 files changed, 20 insertions, 22 deletions
diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c index 285f1efb..ced5e1ea 100644 --- a/dbus/dbus-marshal-validate.c +++ b/dbus/dbus-marshal-validate.c @@ -482,6 +482,25 @@ _dbus_validate_body_with_reason (const DBusString *expected_signature, } /** + * Determine wether the given charater is valid as the first charater + * in a name. + */ +#define VALID_INITIAL_NAME_CHARACTER(c) \ + ( ((c) >= 'A' && (c) <= 'Z') || \ + ((c) >= 'a' && (c) <= 'z') || \ + ((c) == '_') ) + +/** + * Determine wether the given charater is valid as a second or later + * character in a name + */ +#define VALID_NAME_CHARACTER(c) \ + ( ((c) >= '0' && (c) <= '9') || \ + ((c) >= 'A' && (c) <= 'Z') || \ + ((c) >= 'a' && (c) <= 'z') || \ + ((c) == '_') ) + +/** * Checks that the given range of the string is a valid object path * name in the D-BUS protocol. Part of the validation ensures that * the object path contains only ASCII. @@ -535,7 +554,7 @@ _dbus_validate_path (const DBusString *str, } else { - if (_DBUS_UNLIKELY (!_DBUS_ISASCII (*s))) + if (_DBUS_UNLIKELY (!VALID_NAME_CHARACTER (*s))) return FALSE; } @@ -550,25 +569,6 @@ _dbus_validate_path (const DBusString *str, } /** - * Determine wether the given charater is valid as the first charater - * in a name. - */ -#define VALID_INITIAL_NAME_CHARACTER(c) \ - ( ((c) >= 'A' && (c) <= 'Z') || \ - ((c) >= 'a' && (c) <= 'z') || \ - ((c) == '_') ) - -/** - * Determine wether the given charater is valid as a second or later - * character in a name - */ -#define VALID_NAME_CHARACTER(c) \ - ( ((c) >= '0' && (c) <= '9') || \ - ((c) >= 'A' && (c) <= 'Z') || \ - ((c) >= 'a' && (c) <= 'z') || \ - ((c) == '_') ) - -/** * Checks that the given range of the string is a valid interface name * in the D-BUS protocol. This includes a length restriction and an * ASCII subset, see the specification. diff --git a/dbus/dbus-types.h b/dbus/dbus-types.h index 0bbc9295..55ddf434 100644 --- a/dbus/dbus-types.h +++ b/dbus/dbus-types.h @@ -29,8 +29,6 @@ #include <stddef.h> -typedef unsigned short dbus_uint16_t; -typedef short dbus_int16_t; typedef unsigned int dbus_uint32_t; typedef int dbus_int32_t; typedef dbus_uint32_t dbus_unichar_t; |