First work on .desktop file brouhaha [PATCH]

John Tapsell johnflux at gmail.com
Thu Feb 19 06:14:01 GMT 2009


2009/2/19 Michael Pyne <mpyne at purinchu.net>:
> I've done a bit of working on making the .desktop files less likely to cause
> grief for unwitting KDE users (as mentioned on LWN.net and Slashdot).

Thank you for this work!
> * Is the path to the file relative? If so permit it for now as it will be
> searched for later (this is my assumption at least, I have not gone through
> the code paths to verify).

I don't understand this.  Why not just turn relative paths into
absolute paths and then check them in the same way?

> * If still not, could the user create the file? If not allow it.

Maybe allow only if the user can't write to it _and_ it's owned by
root?  I can't think of a problem with your way, but..  I feel a bit
uneasy.  Taking _away_ write permissions shouldn't suddenly allow the
desktop file to be executed.

Just as a minor point:
requestResult.error = i18n("Service '%1' is malformatted.",
service->entryPath());
+ if (service->isValid())
+ requestResult.error = i18n("Service '%1' must be executable to
run.", service->entryPath());

Could you make this an if-else  instead, just to save setting error
and then changing it.  Save one i18n lookup :-)

John




More information about the kde-core-devel mailing list