Safe to call _dbus_validate_bus_name()?

Thiago Macieira thiago at
Fri Mar 5 00:57:35 PST 2010

Em Sexta-feira 05 Março 2010, às 08:50:40, Michael 'Mickey' Lauer escreveu:
> Am Freitag, den 05.03.2010, 15:39 +0800 schrieb Soh Kam Yung:
> > Hello,
> > 
> > I'm in a charge of a library that wraps about libdbus.
> > 
> > There has been a request for my wrapper library to detect invalid dbus
> > bus names that don't meet the dbus specification
> > [
> > -names].
> > 
> > Currently, my library causes an assert error when it calls
> > dbus_bus_request_name() with an invalid name.  Ideally, I should
> > detect the invalid bus name and return an error to the caller.
> That has been bothering myself as well; first off, a library should
> _never_ ever abort(), second, since the function is already available,
> it should be exposed to clients. Same goes for the path validation, btw.

Well, libdbus-1 does abort if you give it invalid parameters.

Which unfortunately means all checks are done twice on everything.
Thiago Macieira - thiago (AT) - thiago (AT)
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the dbus mailing list