[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: Fix sanitization of dbus path in KMainWindow
From:       Thiago Macieira <thiago () kde ! org>
Date:       2009-08-11 12:55:54
Message-ID: 200908111455.55003.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (Text/Plain)]

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

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic