Commit 4fce2850 authored by Havoc Pennington's avatar Havoc Pennington

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
parent cc63ef88
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
2005-01-17 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml: partially update spec
......
......@@ -481,6 +481,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
......@@ -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;
}
......@@ -549,25 +568,6 @@ _dbus_validate_path (const DBusString *str,
return TRUE;
}
/**
* 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
......
......@@ -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;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment