Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 320875 - x11-libs/qt-dbus considers '-' an illegal character in property names (meaning trouble to consolekit)
Summary: x11-libs/qt-dbus considers '-' an illegal character in property names (meanin...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Qt Bug Alias
URL: http://bugs.freedesktop.org/show_bug....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-21 13:38 UTC by Richard
Modified: 2011-11-28 23:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for Qt-Dbus that legalizes the usage of '-' in member names (qdbusutil.cpp.patch,418 bytes, patch)
2010-05-24 01:06 UTC, Richard
Details | Diff
x11-libs/qt-dbus-4.6.2.ebuild that uses the proposed patch (qt-dbus-4.6.2.ebuild,1.07 KB, text/plain)
2010-05-24 01:07 UTC, Richard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2010-05-21 13:38:47 UTC
"As shown in ..., the dash-dash style properties produce
errors within KDE, as QtDBus does not treat '-' as valid character for
properties." - Michael Biebl

See the included url for additional details.

Reproducible: Always

Steps to Reproduce:
1. Install KDE
2. Start KDE
3. View ~/.xsession-errors file




~/.xsession-errors contains:

Invalid D-BUS member name 'idle-hint' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'is-local' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'x11-display-device' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'x11-display' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'display-device' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'remote-host-name' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'session-type' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'unix-user' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection

This occurs because the specification is unclear as to the naming rules for properties. KDE's developers interpreted them in a way that disallowed the use of the '-' character while ConsoleKit's developers interpreted them in a way that allowed the use of the '-'. While KDE is the only affected software of which I am aware, there could be other software that is affected as well. While KDE's behavior probably could be modified by upstream, it would probably be best to patch ConsoleKit to use FirstLetterCaps-style property names to eliminate the possibility of future issues..
Comment 1 Richard 2010-05-24 01:06:12 UTC
Created attachment 232651 [details, diff]
Patch for Qt-Dbus that legalizes the usage of '-' in member names

I was looking at the code for ConsoleKit and patching it to use different style names would have required making changes in dozens of places and I was concerned that changing these names would affect other software packages installed on the system, so I decided to try patching Qt-Dbus instead.

I had expected Qt-Dbus to be extremely complex, but the code was well written, well documented and easy to patch. I only had to make a single change, which resolves the issue from KDE's end. After rebuilding Qt-Dbus with the patch from a local overlay and I can confirm that both it works well and the code no longer complains in ~/.xsession-errors, although that was to be expected because I read the code that produced the error and verified that my modification would cause the code to avoid an error.

I am attaching the patch I made for Qt-Dbus that allows '-' in member names.
Comment 2 Richard 2010-05-24 01:07:19 UTC
Created attachment 232653 [details]
x11-libs/qt-dbus-4.6.2.ebuild that uses the proposed patch

Here is an ebuild that people could use in a local overlay to verify that the patch works.
Comment 3 Richard 2010-05-24 01:31:28 UTC
I have submitted this patch to upstream for possible inclusion into QtDBus 4.6.3:

http://bugreports.qt.nokia.com/browse/QTBUG-10927
Comment 4 Richard 2010-05-24 02:34:58 UTC
I have actually had a brief email correspondence with one of Gentoo's developers regarding this and I would like to add a few observations.

1. The D-Bus specification allows '-' within bus names, but not within member names, interface names or error names.

2. QtDBus appears to call everything within its error messages an interface name and makes no attempt to distinguish between them, considering the use of '-' in any name illegal.

3. Until this point, I had been using the names "member", "property" and "bus" interchangeably because I did not realize that there was a distinction.

4. It is unclear whether ConsoleKit is using '-' within a bus name or not. If ConsoleKit is using '-' within a bus name, then what it does is perfectly legal. If it is not using '-' within a bus name, then it needs to be changed. Changing ConsoleKit would involve modifying several dozen locations within its code, might break other system software and would be a nightmare to maintain.

5. Modifying QtDBus to allow '-' is an easy one-liner, but the modification appears to also allow '-' within member names, interface names and error names. It is not clear to me how QtDBus can be modified to allow '-' within bus names, but not within member names, interface names and error names. Right now, QtDBus is applying the no '-' rule to everything, which is wrong and likely breaks some legal programs, of which ConsoleKit might be one. Modifying QtDBus to allow '-' would fix things for legal programs, but would fail to break illegal programs, of which I am not aware that any exist at this point in time.

6. It might be a good idea if the D-Bus specification were revised to allow '-' in all names, because while '-' in a name right now means that it is a bus name, assuming a program is following the rules, there is nothing to require '-' be used in bus names. I am not sure to whom one would submit a proposal for that.
Comment 5 Sebastian Pipping gentoo-dev 2010-05-24 03:58:57 UTC
Richard, thanks for your work on this bug so far.  Assigning to Qt herd now.
Comment 6 Richard 2010-05-25 14:52:59 UTC
Upstream closed my bug report citing '-' as being illegal according to the D-Bus specification. I replied with information that '-' is legal in bus names according to the D-Bus specification with a reference for that, but I am not sure if they will see it. :/
Comment 7 Davide Pesavento gentoo-dev 2010-05-25 18:15:56 UTC
http://bugs.freedesktop.org/show_bug.cgi?id=20948
Comment 8 Davide Pesavento gentoo-dev 2011-11-28 23:26:03 UTC
Upstream made it clear that they don't intend to change the current behaviour, and we'll follow upstream decision.