[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarch
From: |
Thierry Volpiatto |
Subject: |
bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy |
Date: |
Fri, 13 Jan 2012 12:19:23 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
>> Cc: 10489@debbugs.gnu.org
>> Date: Fri, 13 Jan 2012 09:38:30 +0100
>>
>> > I don't think this will solves all the use cases. File names are not
>> > strings, you cannot compare them as literal strings and hope to plumb
>> > all the leaks.
>> A test with `equal' is already used in `dired-create-files',
>> (equal from to)
>> Is it the correct way to compare two filenames?
>
> I don't see how `equal' could help, unless someone teaches it to treat
> strings that are file names specially. I don't see such treatment in
> the current sources.
>
>> > Some situations which I think this patch will not handle correctly:
>> >
>> > . file names with different letter-case on a case-insensitive file
>> > system
>> Can you provide example or better a recipe.
>
> emacs -Q
> C-x d ~ RET
> <go to the line showing "Test">
> C ~/test RET
> yes RET
>
>> > . relative vs absolute file names
>> Same.
>
> M-: (dired-copy-file-recursive "foo/../Test" "./Test" t) RET
>
>> > . file names that are hard links to the same directory (this includes
>> > the infamous 8+3 short aliases on Windows)
>> Don't know on Windows, (My knowledge of links in windows is very
>> limited)
>> here it is difficult (impossible as User) to Hardlink a directory:
>>
>> --8<---------------cut here---------------start------------->8---
>> man ln:
>> -d, -F, --directory
>> allow the superuser to attempt to hard link directories
>> (note: will probably fail due to system restrictions,
>> even for the superuser)
>> --8<---------------cut here---------------end--------------->8---
>
> We don't disallow superusers from using Emacs, nor restrict Emacs
> usage only to filesystems where links to directories are impossible,
> do we? ;-)
I just want to be able to test:
cp "a_hardlink_of_/foo" "/foo"
> And what about symlinks?
>
> On Windows, you can have "C:/PROGRA~1" be the alias of
> "C:/Program Files", for example.
>
> Bottom line, I think you need:
>
> . make both file names absolute by calling expand-file-name on each
Ok
> . resolve links by calling file-truename on each (this will handle
> the 8+3 alias issue, as well as, AFAIK, the issue with links)
Ok
> . compare case-insensitively on MS-Windows and MS-DOS
let binding case-fold-search should be ok.
Thanks, I will add these modifications to the patch handling remote files.
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Michael Heerdegen, 2012/01/12
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Thierry Volpiatto, 2012/01/12
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Eli Zaretskii, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Thierry Volpiatto, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Eli Zaretskii, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy,
Thierry Volpiatto <=
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Juanma Barranquero, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Eli Zaretskii, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Michael Albinus, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Juanma Barranquero, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Juanma Barranquero, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Juanma Barranquero, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Michael Albinus, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Stefan Monnier, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Thierry Volpiatto, 2012/01/13
- bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy, Michael Albinus, 2012/01/13