Review Request: Fix sanitization of dbus path in KMainWindow

Thiago Macieira thiago at kde.org
Tue Aug 11 13:55:54 BST 2009


Em Terça-feira 11 Agosto 2009, às 13:56:01, Tom Albers escreveu:
> > On 2009-08-11 05:23:13, Chani wrote:
> > > how will this affect applications that do have a - in their name? and
> > > applications that use the dbus interface of those apps?
> >
> > thomasl wrote:
> >     As a dbus path attempt of "/some-app/MainWindow_1" is catched by an
> > assertion in Qt (for being invalid) there's never been a chance that you
> > used it this way
> >
> >     If we'd however catch the appName in KAboutData to align the dbus
> > path with e.g. qApp->applicationName(), this would -likely- affect at
> > least the KConfig rc path and possibly the way it registers with
> > KGlobalAction :-(
> >
> >     (if anyone wonders, i had of course a much cooler "." in my failing
> > app ;-)
> >
> >     As the limitiation of the appName would be artificial, one could also
> > choose to change the dbus path system of KMainWindow to e.g.
> > "/MainWindows/MainWindow_1", "/MainWindows/MainWindow_2", etc. - but that
> > would break everything here :-(
>
> Concrete question: will:
>
>  QDBusInterface dbus( "org.kde.plasma-desktop", "/App" );
>
> change into
>
>  QDBusInterface dbus( "org.kde.plasmadesktop", "/App" );
>
> ?

No.

You're mixing interfaces and services. You can have dashes in service names, 
so org.kde.plasma-desktop is perfectly valid:

$ qdbus org.kde.plasma-desktop
/
/App
/KBookmarkManager
/KBookmarkManager/kfilePlaces
/KIO
/KIO/Scheduler
/MainApplication
/kickoff
/kickoff/RecentAppDoc

However, you cannot have dashes in interface names:

$ qdbus org.kde.plasma-desktop /MainApplication
Invalid D-BUS interface name 'org.kde.plasma-desktop.PlasmaApp' found while 
parsing introspection

You cannot construct a QDBusInterface object with that interface name. Even if 
you could, the interface cannot be called because the bus will reject such 
messages. If you try, you'll get disconnected.

That interface name is auto-created by QtDBus itself and should be fixed there.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14     San Francisco, California: Nov 2 - 4
      http://qt.nokia.com/qtdevdays2009
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090811/e90943b5/attachment.sig>


More information about the kde-core-devel mailing list