GNU bug report logs - #65902
29.0.92; emacsclient-mail.desktop fails due to complicated escaping

Previous Next

Package: emacs;

Reported by: sbaugh <at> catern.com

Date: Wed, 13 Sep 2023 02:25:01 UTC

Severity: normal

Tags: patch

Found in version 29.0.92

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: sbaugh <at> catern.com
Cc: jporterbugs <at> gmail.com, sbaugh <at> janestreet.com, 65902 <at> debbugs.gnu.org
Subject: bug#65902: 29.0.92; emacsclient-mail.desktop fails due to complicated escaping
Date: Thu, 14 Sep 2023 16:36:06 +0300
> From: sbaugh <at> catern.com
> Date: Thu, 14 Sep 2023 11:03:44 +0000 (UTC)
> Cc: Jim Porter <jporterbugs <at> gmail.com>, 65902 <at> debbugs.gnu.org,
> 	sbaugh <at> janestreet.com
> 
> The issue is not really with the desktop file.  It's a generic problem:

No, it isn't.  If it were, we'd have heard about it much sooner, and
not because of the desktop files.

What you are doing is representing a rare problem related to a niche
feature is if it were a general one, by inventing use cases to justify
that.  But if those use cases were important, people would have asked
for them long ago.  They didn't.  Why? because --eval already exists.

> > What about alternative solutions: use a shell script in the desktop
> > files, and delegate to that script to solve the problem with quoting?
> > Had anyone considered this strategy?  If not, why not?
> 
> Getting the quoting right is hard and complex, and even Emacs developers
> have failed at it over multiple iterations, and when they fail it either
> breaks or exposes a security vulnerability.

Emacs developers make mistakes even in the simple regexps we have in
our code.  That doesn't mean we should abandon regexps.  The solution
for sending Lisp forms to the server exists, and the quoting, although
tricky in some cases, is not rocket science to get right.  I don't see
why we would need another mechanism to do something similar with
radically different syntax, a separate set of rules and restrictions
that need to be documented, etc. etc.

> This solution is far simpler

That's an illusion.  There's nothing simple about it.  You are
inventing a new mechanism for passing Lisp forms as something other
than Lisp.  This has got to have issues into which we will bump sooner
or later.  E.g., assume that two or more of the arguments to the
function begins with single quote, as in

  $ emacsclient --apply func arg1 'foo arg2 'bar

Escape-quoting, here we come again!




This bug report was last modified 1 year and 205 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.