[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#16984: dired-do-rename susceptible to .../~/... hijack
From: |
npostavs |
Subject: |
bug#16984: dired-do-rename susceptible to .../~/... hijack |
Date: |
Thu, 08 Dec 2016 23:56:43 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: npostavs@users.sourceforge.net
>> Cc: 16984@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
>> jidanni@jidanni.org
>> Date: Thu, 08 Dec 2016 09:39:35 -0500
>>
>> (defun minibuffer-maybe-quote-filename (filename)
>> "Protect FILENAME from `substitute-in-file-name', as needed.
>> Useful to give the user default values that won't be substituted."
>> (let ((local (file-remote-p filename 'localname)))
>> (if (and (not (string-prefix-p "/:" local))
>> (file-name-absolute-p filename)
>> (string-match-p "/~" local))
>> (tramp-quote-name filename)
>> (minibuffer--double-dollars filename))))
>
> Is the argument guaranteed to come from expand-file-name? If not, it
> should also accept file names matching "\~" on MS platforms.
I think it does, but I'm not entirely sure. Better safe than sorry?
v5-0001-Quote-filenames-containing-in-prompts.patch
Description: patch