[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: .desktop files of GNOME apps and path to these applications

On Wed, Jul 09, 2008 at 01:14:25PM +0200, Vincent Lefevre wrote:

||  The .desktop file distributed with the evince package
||  (/usr/share/applications/evince.desktop) contains:
||    Exec=evince %U
||  meaning that the user's $PATH is taken into account. In general,
||  taking $PATH into account is recommended, but IMHO, this should
||  not be the case here, because of the following points (related
||  to each other):
||  1. This .desktop file is a file associated with /usr/bin/evince
||     (distributed in the same package...).

NFS-mounted /home could be used on multiple computers, where the same
(compatible) evince is installed at different locations.

||  2. Taking the user's $PATH into account may have unexpected effects,
||     such as running a different version of evince which may accept a
||     different set of MIME types, or worse, running an evince program
||     that has a completely different behavior: the user (who may be
||     different from the administrator of the machine and may not know
||     GNOME's evince) may have written a program called "evince" (FYI,
||     this is a French word that means "oust") and installed it in his
||     $HOME/bin directory.

A user who is clever enough to extend his PATH should clever enough to
find out why his evince script is suddenly being executed.

||  3. In config files, $PATH is generally used when one doesn't know
||     the location of the program, for flexibility, but this is not
||     the case here (see point 1).

PATH is part of the environment. An eminent use of environment is to
inform programs of precisely that: their environment, such as where
other programs are to be found. Use it, that's what it's for.

Not using PATH to locate programs would be an exception to this rule. You
don't want exceptions, because it hampers the predictability of the

||  Note that this is a followup to bug 488971:
||    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488971
||  (With xulrunner-1.9-gnome-support, iceweasel announces e.g. xpdf,
||  but actually launches evince.)

That bug is more about firefox not running the helper application that
is says it is going to run (by whatever cause).

Writing a script with destructive potential and putting it in front
in your PATH has a dangerous potential. This can aggravate the impact
of #488971, but it is still a bug in firefox or in its neighborhood,
not in PATH searching.

Ciao.                                                            Vincent.
Vincent Zweije <zweije@xs4all.nl>    | "If you're flamed in a group you
<http://www.xs4all.nl/~zweije/>      | don't read, does anybody get burnt?"
[Xhost should be taken out and shot] |            -- Paul Tomblin on a.s.r.

Attachment: signature.asc
Description: Digital signature

Reply to: