From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: bug#30228: desktop files embedding full path Date: Sun, 18 Feb 2018 21:06:11 +0100 Message-ID: <87r2pi5ah8.fsf@elephly.net> References: <20180123110012.GB16202@macbook41> <87o9ljxpzo.fsf@gnu.org> <20180129193946.GD17751@macbook41> <87r2q7393h.fsf@gnu.org> <20180218190338.GA30140@macbook41> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enVEn-0001Bo-B0 for bug-guix@gnu.org; Sun, 18 Feb 2018 15:07:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enVEk-0008HM-56 for bug-guix@gnu.org; Sun, 18 Feb 2018 15:07:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:42286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enVEk-0008HG-0I for bug-guix@gnu.org; Sun, 18 Feb 2018 15:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1enVEj-0003D4-Ml for bug-guix@gnu.org; Sun, 18 Feb 2018 15:07:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <20180218190338.GA30140@macbook41> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Efraim Flashner Cc: 30228@debbugs.gnu.org Efraim Flashner writes: > On Tue, Jan 30, 2018 at 12:00:02PM +0100, Ludovic Court=C3=A8s wrote: >> Hello, >>=20 >> Efraim Flashner skribis: >>=20 >> > On Wed, Jan 24, 2018 at 03:58:51PM +0100, Ludovic Court=C3=A8s wrote: >> >> Hi, >> >>=20 >> >> Efraim Flashner skribis: >> >>=20 >> >> > the owncloud-client package includes an option to add a .desktop en= try >> >> > to $HOME/.configure/autostart/, which allows it to autostart when y= ou >> >> > log in to your desktop environment. Because the full path of the bi= nary >> >> > is in the .desktop file, it will always start THAT copy of >> >> > owncloud-client, even if it is garbage collected. >> >>=20 >> >> I think you shouldn=E2=80=99t copy manually the .desktop file to >> >> ~/.configure/autostart, precisely because of that. >> >>=20 >> >> Instead this should be done via in indirect GC root (as in =E2=80=9Cg= uix build >> >> -r the-root owncloud-client=E2=80=9D) or, ideally, by having it GuixS= D-managed. >> >>=20 >> >> Thoughts? >> >>=20 >> >> Ludo=E2=80=99. >> > >> > I agree it shouldn't copy a .desktop file into .config/autostart/. In >> > this case, the offending code is here=C2=B9, so there's not much that = can be >> > done about it. In mine I've changed the Exec line to >> > /var/guix/profiles/per-user/... so it'll work as expected. In this cas= e >> > the code generates a desktop file on the fly, so modifying the .deskto= p >> > file shipping with applications wouldn't even help here. >> > >> > >> > =C2=B9 https://github.com/owncloud/client/blob/f326bf371d690f1929f7c5c= 06aebf53c7255daa6/src/common/utility_unix.cpp#L73 >>=20 >> What do you think should be done on the Guix side? We could patch the >> code above to not install the .desktop file in ~/.config, for instance. >>=20 >> Thanks, >> Ludo=E2=80=99. > > I've been thinking about it and it would also just be possible to patch > the exec line there to only have the binary name. As an unintended > consquence, if you did add the desktop entry to .config/autostart/ and > the exec was only 'owncloud-client' then we would match the other > distros' behaviors of not running uninstalled programs, if you were to > later uninstall owncloud-client from your profile. > > I bet the reason it is coded this way is to allow for > /usr/bin/owncloud-client or /usr/local/bin/owncloud-client, but just > 'owncloud-client' will pick up the executable if it is in the runpath. > > I think that's the best option, to change the 'exec' line to just > 'owncloud-client'. Would that pick up owncloud-client if there is an executable of that name somewhere in PATH? Could this be a security problem? --=20 Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net