GNU bug report logs - #22477
24.5; Dired does not work if file names contain newlines

Previous Next

Package: emacs;

Reported by: Aura Kelloniemi <kaura.dev <at> sange.fi>

Date: Wed, 27 Jan 2016 16:35:03 UTC

Severity: minor

Merged with 35578, 43789

Found in versions 24.5, 27.1

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: Aura Kelloniemi <kaura.dev <at> sange.fi>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 22477 <at> debbugs.gnu.org
Subject: bug#22477: 24.5; Dired does not work if file names contain newlines
Date: Wed, 27 Jan 2016 21:30:58 +0200
Glenn Morris <rgm <at> gnu.org> writes:

 > Aura Kelloniemi wrote:

 > > 1. Create a file which contains a newline character in its name.

 > If you like to do weird things like that, adding "-b" to
 > dired-listing-switches helps.

Oh no, I don't like to do such weird things. My point is not to nitpick or
irritate you. I'm just interested about completeness: if Unix supports file
names with control characters (which arguably is a questionable feature), then
Dired (being the best file manager on the planet) should IMHO be able to deal
with them, or at least document the incompatibility clearly.

Also I wonder if a cracker can confuse Dired by creating a file name like this
"Hello World.txt\ndrwx-r--r--  1 user users ..."

-b probably is not portable, because it's not Dired's default. But Dired could
 test for -b just like it tests for --dired. WDired should also support these
 escapes.

I tried to edit with WDired a symbolic link which points to a file containing
 the string "->" which is a real file on my system. (In music files I use ->
 to separate the performer and composition names.) This did not work either.
 WDired failed with error "wdired-get-filename: Wrong type argument:
 integer-or-marker-p, nil".
 
I noticed too, that the -F switch to ls makes Dired fail the same way as file
names with embedded newlines. It was hard to google for this issue, others
have certainly faced it too. But (again IMHO) -F shouldn't break Dired, or at
least there should be another way to have Dired put a slash at the end of
directory names.

I wish you could do something to these issues. If you can't extend Dired's and
WDired's escaping support, you could at least document the issues.

Anyway, thank you for reading my complaints.

-- 
Aura




This bug report was last modified 4 years and 227 days ago.

Previous Next


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