Validation of paths, interfaces, members etc.

Marcin ‘Qrczak’ Kowalczyk qrczak at knm.org.pl
Wed Jan 9 11:39:49 PST 2008


Hello.

I am wrapping libdbus in my language Kogut.

One of the goals is avoiding warnings or errors emitted by libdbus even
if the Kogut API is used incorrectly. Misuse should be reported with
exceptions.

It's hard to tell to what extent the goal has been achieved, but one
place where I'm fairly sure that it's tricky to detect errors which
libdbus treats as programs errors is validation of various forms of
strings. I mean that libdbus doesn't export functions which do the
validation, so the only way to protect against libdbus errors is to
duplicate the validation by hand (except address validation which is
reported through DBusError). Am I missing something? Why aren't
validation functions exported?

Another place which need some additional error checking is registering
the same path multiple times. This can easily be checked with
dbus_connection_get_object_path_data (assuming that I always use
a non-NULL pointer as the data of course), even if I would prefer
dbus_connection_register_{object_path,fallback} to indicate the status
with its return value instead of calling _dbus_warn.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/



More information about the dbus mailing list