Safe to call _dbus_validate_bus_name()?

Soh Kam Yung sohkamyung at gmail.com
Fri Mar 5 01:12:11 PST 2010


On Fri, Mar 5, 2010 at 4:57 PM, Thiago Macieira <thiago at kde.org> wrote:
> 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
>> > [http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol
>> > -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.

It looks like I'll have to (re-)implement the validity check in my library.

Thanks for the replies.

Regards
Kam-Yung
-- 
Soh Kam Yung
my Google Reader Shared links:
(http://www.google.com/reader/shared/16851815156817689753)
my Google Reader Shared SFAS links:
(http://www.google.com/reader/shared/user/16851815156817689753/label/sfas)


More information about the dbus mailing list