dbus/dbus dbus-marshal-validate.c,1.5,1.6 dbus-types.h,1.11,1.12

Havoc Pennington hp@freedesktop.org
Mon Jan 17 19:03:09 PST 2005


Update of /cvs/dbus/dbus/dbus
In directory gabe:/tmp/cvs-serv14587/dbus

Modified Files:
	dbus-marshal-validate.c dbus-types.h 
Log Message:
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



Index: dbus-marshal-validate.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-marshal-validate.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dbus-marshal-validate.c	17 Jan 2005 22:03:18 -0000	1.5
+++ dbus-marshal-validate.c	18 Jan 2005 03:03:07 -0000	1.6
@@ -482,6 +482,25 @@
 }
 
 /**
+ * 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 @@
         }
       else
         {
-          if (_DBUS_UNLIKELY (!_DBUS_ISASCII (*s)))
+          if (_DBUS_UNLIKELY (!VALID_NAME_CHARACTER (*s)))
             return FALSE;
         }
 
@@ -550,25 +569,6 @@
 }
 
 /**
- * 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.

Index: dbus-types.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-types.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- dbus-types.h	17 Jan 2005 19:49:52 -0000	1.11
+++ dbus-types.h	18 Jan 2005 03:03:07 -0000	1.12
@@ -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;



More information about the dbus-commit mailing list