Contradiction in bus names naming in D-Bus spec

Igor Plastov chetverovod at gmail.com
Thu Feb 4 09:27:23 UTC 2021


Glib for Windows:

 gboolean name_ok = false;

    g_print("Glib version %i.%i.%i for Windows.\n", glib_major_version,

            glib_minor_version, glib_micro_version);


    gchar* name=":"; // Шинное имя процесса.

    name_ok = g_dbus_is_name(name);

    g_print("Process bus name <%s> check: <%s>\n",name, name_ok   ?
"good" : "bad" );


    name=":.a"; // Шинное имя процесса.

    name_ok = g_dbus_is_name(name);

    g_print("Process bus name <%s> check: <%s>\n", name, name_ok   ?
"good" : "bad" );


Output:


Glib version 2.44.1 for Windows.

Process bus name <:> check: <bad>

Process bus name <:.a> check: <good>



ср, 3 февр. 2021 г. в 03:36, Thiago Macieira <thiago at kde.org>:

> On Monday, 1 February 2021 07:25:43 PST Igor Plastov wrote:
> > Just ":" is also valid:
> > ~# python3 -ic "import dbussy"
> >
> > >>> dbussy.validate_bus_name(":")
> >
> > True
> >
> > It looks strange.
>
> Those are unique connection names and can only be created by the bus. One
> must
> assume that the bus only creates valid names for itself.
>
> The implementation I have in QDBusUtil::isValidUniqueConnectionName()
> would
> return false for ":" and ":.a" though.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>    Software Architect - Intel DPG Cloud Engineering
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20210204/c66d0c9d/attachment.htm>


More information about the dbus mailing list