Escaping for paths

Havoc Pennington hp at redhat.com
Wed Jun 21 15:52:20 PDT 2006


Ross Burton wrote:
> 
> 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);
> 

A question here is whether you want a DBusError to explain _why_ the 
validation failed, e.g. if you're implementing dbus-send you'd want to 
say "path does not start with slash" rather than "invalid path"

I would say yes; if people don't care about the why they can pass NULL 
for the DBusError, but for validation I'd think you often want the 
error, since it's likely to be a case where the user was specifically 
supposed to provide a valid dbus path or name.

Havoc


More information about the dbus mailing list