From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74467: 31.0.50; org-protocol emacsclient.desktop change is not fully functional Date: Sun, 05 Jan 2025 23:31:51 +0200 Message-ID: <49833.9486237214$1736112761@news.gmane.org> References: <86seriksak.fsf@gnu.org> <87ed27cthy.fsf@localhost> <86cyhrpfbf.fsf@gnu.org> <864j2ot4w1.fsf@gnu.org> <86r05id8f5.fsf@gnu.org> <86o70lahmt.fsf@gnu.org> <87sepxprl1.fsf@localhost> <87r05hnm4i.fsf@localhost> Reply-To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25226"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74467@debbugs.gnu.org, Eli Zaretskii , binarin@binarin.info To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 22:32:35 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tUYEc-0006R9-6A for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 22:32:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUYER-0004Mu-0N; Sun, 05 Jan 2025 16:32:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUYEN-0004Ma-RS for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 16:32:21 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUYEN-0001jH-J5 for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 16:32:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=/IRCrc/F1NEgpvUgPDqsVsPJPpyjEVhktVRE0Gy7+cs=; b=e1qRiTcORByMmASnuDHgPDVtyQLUf2fYeg2oG/oOxyrv4+mG2Z6+Pz06FVvEe486qdmCFxWBlNjso7ZqSWbvHxALSx7i03RaludA2NcHOHR4vgftX4dg7ExPOMV/JvXqhAr0eNoGDRPW/dJevTDPNakA2oQ0Q6hQDg33YpoDOJ86E1JggmHh9adVOxe5CXPWzsuxtk0vMt0FElr65QtTBKT3UfU67AVna60UrNyj1JlNXFX/rLQ78BMUbxQGml97g8PBu5WfUj/4nKQNh0XwAGKylP3hvs6CH3xZqpocDYvEeeOy6bYHs0W00blmgHwrW52/ByLnHkCKxXTKWZXyhw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUYEN-00045u-3Q for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 16:32:19 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 21:32:19 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74467 X-GNU-PR-Package: emacs Original-Received: via spool by 74467-submit@debbugs.gnu.org id=B74467.173611273515728 (code B ref 74467); Sun, 05 Jan 2025 21:32:19 +0000 Original-Received: (at 74467) by debbugs.gnu.org; 5 Jan 2025 21:32:15 +0000 Original-Received: from localhost ([127.0.0.1]:35587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUYEI-00045b-TT for submit@debbugs.gnu.org; Sun, 05 Jan 2025 16:32:15 -0500 Original-Received: from thaodan.de ([2a03:4000:4f:f15::1]:40392) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUYE5-000426-Uz for 74467@debbugs.gnu.org; Sun, 05 Jan 2025 16:32:12 -0500 Original-Received: from odin (dsl-trebng12-50dc7b-49.dhcp.inet.fi [80.220.123.49]) by thaodan.de (Postfix) with ESMTPSA id D7958D00098; Sun, 5 Jan 2025 23:31:52 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1736112713; bh=+i8aVAlkQeR5iX08ZVoJzOIS1I8SlmkwIekpJoGhEmI=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=oMouqtMVpYC5EWH/VPZLFH7dLLQ9XxCamzMUcad7ZLz3ZPYZGufpt5nchi4AIQcos NW8Las56ohxp7BuzPQRB+UaQemV5SPaR1l49DbxP3ckmNQ1iClQJg9KJTPyjkHBu/z SJC3xEkWXdO+HbRw9ZG4LNIQXrcdX+ZpnZo93wun8vkyQIlN+t0LHwie4VFu31GSJW 97gurhyZsyFeg6XcNselauzmz1RwsZGe68lTGfkwyUHN0vOnxKIGoBLl5PbDsiikfP 6hQcEh7T9CcZP5adPk2E2AmoenPuGtXduq3u96mQFsnN7eIkaGZ/In89mQ5esygjxH Wsu5FLBu0VEuXFUzWQzbfWOkrcoq/5L6+JNa7Sdk0Uqj0hxTEth8RqrkAAQ9yM85Xh nZwZMsNYO8tHr+EzncraWeNHBcOsafZiYl96tS/N8yrhEsLUSVP3XwD6w1C0s7il7P TwLcX2+qyPgyNaTqQr7V3zhdjloGlDgolLBHiJ+H97wQPJU+44EDZwFH/IZQQ2ZQpZ VJTeCle2WNfIhP8FRPmnMvyt9z6H6GRtAv8e+0cfFFRYTG03rz4gYe5wBl11cb2IQm ukvdQs/sEqYf0tVHdQgOatFkzGjozXhcodtlM41wLu88SXpJWr5a/ho2wTCOWw5J2H bcI1Hz+mZPaS2kv3tVZjdtKU= In-Reply-To: <87r05hnm4i.fsf@localhost> (Ihor Radchenko's message of "Sun, 05 Jan 2025 18:36:45 +0000") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298616 Archived-At: Ihor Radchenko writes: > Bj=C3=B6rn Bidar writes: > >>> -Exec=3Dsh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient >>> --alternate-editor=3D --display=3D\\"\\$DISPLAY\\" \\"\\$@\\"; else >>> exec emacsclient --alternate-editor=3D --create-frame; fi" sh %F >>> +Exec=3Dsh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient >>> --alternate-editor=3D --display=3D\\"\\$DISPLAY\\" \\"\\$@\\"; else >>> exec emacsclient --alternate-editor=3D --create-frame; fi" sh %U >> >> Do we need the shell code here? if DISPLAY is defined emacsclient could >> shurely forward it to Emacs. > > I think that reasons why sh is there have nothing to do with the issue > at hand. > >> Shellcode is part of the issue. > > How so? > The first message in this thread described exactly why the old version > stopped working: > > On 2023-10-03 there was a change introduced in xdg-utils > https://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=3Db9d3ecf8180c5= 7dbb5ca47253898ba0553e81c60 > to more strictly follow xdg specification, and only pass URL-like > arguments to programs that explicitly requested this by using '%u' or > '%U' parameters. Calling a shell and then the program is more complicated as the argument supplied to Emacs first run through the shell and then Emacs making the arguments subject to the shell parsing rules. > After the above change, %F in our .desktop file prevents xdg-open from > using it for opening URIs. Any URIs, not just org-protocol and co. > > So, %U should fix it, except that it will also signal to xdg-open that > Emacs can handle file:// URI as well; so we need to make sure that > file:// URIs can be opened just fine. It does fix that but dropping the shell in this context helps to avoid any later potential issues.