GNU bug report logs - #16984
dired-do-rename susceptible to .../~/... hijack

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Mon, 10 Mar 2014 22:57:02 UTC

Severity: minor

Tags: confirmed, fixed, patch

Found in version 25.1

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #52 received at 16984 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: npostavs <at> users.sourceforge.net
Cc: Eli Zaretskii <eliz <at> gnu.org>, 16984 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#16984: dired-do-rename susceptible to .../~/... hijack
Date: Thu, 08 Dec 2016 15:58:43 +0100
npostavs <at> users.sourceforge.net writes:

Hi Noam,

>       (let ((local (file-remote-p filename 'localname)))

Well, this is (file-local-name filename) these days.

> Regarding `tramp-quoted-name-p', you should use (string-match "\\`/:"
> ...) or (string-prefix-p "/:" ...), not (string-match "^/:" ...) as the
> latter could get confused by newlines in filenames (of the first two, I
> find the `string-prefix-p' version clearer).

In general you are right. But we don't support newlines in file names;
at least Tramp doesn't, so it makes no difference using "^/:" or "\\`/:".

`string-prefix-p' is the best choice indeed, and I thought about, but
Tramp cannot apply it yet. It has been introduced in Emacs 24.1, and
Tramp still supports Emacs 23. Well, NEWS.24 says that it exists already
since Emacs 23.2, but there is still Emacs 23.1, which is supported by
Tramp.

Best regards, Michael.




This bug report was last modified 8 years and 159 days ago.

Previous Next


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