Escaping for paths

Ross Burton ross at
Thu Jun 15 07:28:22 PDT 2006

On Thu, 2006-06-15 at 08:58 -0400, Havoc Pennington wrote:
> Ross Burton wrote:
> > I think it would be useful for DBus to contain a function that escaped
> > an arbitrary string so that it could be used in an object path to avoid
> > this needless wheel re-inventing.  Anyone else agree?
> Why not propose a complete validation/escaping API, another recent 
> thread mentioned validation also. Probably need validation for 
> interfaces, method names, paths, bus names; escaping only for paths and 
> perhaps bus names?

I'm not sure bus names would need escaping, but maybe somebody will
surprise me.

OK, how about:

dbus_bool_t dbus_validate_bus_name (const char *interface);
dbus_bool_t dbus_validate_interface (const char *interface);
dbus_bool_t dbus_validate_method_name (const char *interface);
dbus_bool_t dbus_validate_path (const char *interface);

char *dbus_escape_path (const char *path);

Ross Burton                                 mail: ross at
                                          jabber: ross at
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

More information about the dbus mailing list