1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-12 09:28:24 +00:00
Commit Graph

7 Commits

Author SHA1 Message Date
Ulrich Müller
c8ec0017cb Avoid using bash in the emacsclient desktop file
* etc/emacsclient-mail.desktop (Exec): Use sh and sed instead
of bash, because the latter may not be available everywhere.
2023-03-08 19:37:27 +01:00
Ulrich Müller
3c1693d08b Fix Elisp code injection vulnerability in emacsclient-mail.desktop
A crafted mailto URI could contain unescaped double-quote
characters, allowing injection of Elisp code.  Therefore, any
'\' and '"' characters are replaced by '\\' and '\"', using Bash
pattern substitution (which is not available in the POSIX shell).

We want to pass literal 'u=${1//\\/\\\\}; u=${u//\"/\\\"};' in the
bash -c command, but in the desktop entry '"', '$', and '\' must
be escaped as '\\"', '\\$', and '\\\\', respectively (backslashes
are expanded twice, see the Desktop Entry Specification).

Reported by Gabriel Corona <gabriel.corona@free.fr>.

* etc/emacsclient-mail.desktop (Exec): Escape backslash and
double-quote characters.
2023-03-07 18:25:37 +01:00
Ulrich Müller
d32091199a Fix quoted argument in emacsclient-mail.desktop Exec key
Apparently the emacsclient-mail.desktop file doesn't conform to the
Desktop Entry Specification at
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
which says about the Exec key:

| Field codes must not be used inside a quoted argument, the result of
| field code expansion inside a quoted argument is undefined.

However, the %u field code is used inside a quoted argument of the
Exec key in both the [Desktop Entry] and [Desktop Action new-window]
sections.
* etc/emacsclient-mail.desktop (Exec): The Desktop Entry
Specification does not allow field codes like %u inside a quoted
argument. Work around it by passing %u as first parameter ($1)
to the shell wrapper.
* etc/emacsclient.desktop (Exec): Use `sh` rather than `placeholder`
as the command name of the shell wrapper.  (Bug#60204)
2022-12-24 09:19:40 +02:00
Peter Oliver
aea7823a7e Hint that emacsclient.desktop should match a search for “emacsclient”
This is necessary to get the Gnome desktop to show “Emacs (Client)”
when the user searches for “emacsclient”.

* etc/emacsclient.desktop, emacsclient-mail.desktop (Keywords): Add
“emacsclient”.
2021-08-11 14:05:14 +02:00
Peter Oliver
0a4b66f827 Valid quoting in .desktop files
* etc/emacsclient.desktop, emacsclient-mail.desktop (Exec): Quote
according to the rules in the Freedesktop.org Desktop Entry
Specification.
2021-08-11 14:04:58 +02:00
Peter Oliver
38aa2074f8 Hide emacs-mail.desktop, emacsclient-mail.desktop from menus
These are intended for use as mailto: URL handlers, not for launching
directly, so we can reduce clutter by hiding them from a desktop
environment’s menus.

* etc/emacs-mail.desktop, etc/emacsclient-mail.desktop: NoDisplay=true
2021-07-02 13:09:18 +02:00
Peter Oliver
b1b05c828d Provide an emacsclient-mail.desktop
We provide both an emacs.desktop and an emacsclient.desktop, so for
consistency let’s do the same with mail.

* etc/emacs-mail.desktop: Extract suggestions for using emacsclient
from comments to create emacsclient-mail.desktop.
* etc/emacsclient-mail.desktop: Send mail using an existing Emacs
rather than starting a new one.
2021-07-02 13:09:08 +02:00