Re: Deleting a directory with the same name as a shortcut deletes everything in CWD

2022-08-09 Thread Ken Brown
On 8/9/2022 4:01 PM, Oskar Skog wrote: On 2022-08-09 22:52, Ken Brown wrote: I think the best fix is to set res = 0 at the beginning of the loop and to remove a "res = -1" that occurs later.  I've sent a patch to cygwin-patches. Ken From

Re: Deleting a directory with the same name as a shortcut deletes everything in CWD

2022-08-09 Thread Oskar Skog
On 2022-08-09 22:52, Ken Brown wrote: I think the best fix is to set res = 0 at the beginning of the loop and to remove a "res = -1" that occurs later.  I've sent a patch to cygwin-patches. Ken From https://cygwin.com/pipermail/cygwin-patches/2022q3/011994.html > Currently it is possible

Re: Deleting a directory with the same name as a shortcut deletes everything in CWD

2022-08-09 Thread Ken Brown
On 8/8/2022 7:29 PM, Ken Brown wrote: On 8/8/2022 7:56 AM, Christian Franke wrote: Testcase: $ ls -a .  .. $ touch link.lnk file.txt $ ls -a .  ..  file.txt  link.lnk $ stat -c %F link.lnk regular empty file $ stat -c %F link directory This happens because symlink_info::check returns -1

Re: Deleting a directory with the same name as a shortcut deletes everything in CWD

2022-08-08 Thread Ken Brown
On 8/8/2022 7:56 AM, Christian Franke wrote: Testcase: $ ls -a .  .. $ touch link.lnk file.txt $ ls -a .  ..  file.txt  link.lnk $ stat -c %F link.lnk regular empty file $ stat -c %F link directory This happens because symlink_info::check returns -1 instead of 0 when called on "link".

Re: Deleting a directory with the same name as a shortcut deletes everything in CWD

2022-08-08 Thread Christian Franke
Oskar Skog wrote: Deleting a directory with the same name as a shortcut deletes everything in the current working directory. Tested on: CYGWIN_NT-10.0-19044 3.3.5-341.x86_64 2022-05-13 12:27 UTC x86_64 Cygwin CYGWIN_NT-10.0-22000 3.3.5-341.x86_64 2022-05-13 12:27 UTC x86_64 Cygwin Script to

Deleting a directory with the same name as a shortcut deletes everything in CWD

2022-08-08 Thread Oskar Skog
Deleting a directory with the same name as a shortcut deletes everything in the current working directory. Tested on: CYGWIN_NT-10.0-19044 3.3.5-341.x86_64 2022-05-13 12:27 UTC x86_64 Cygwin CYGWIN_NT-10.0-22000 3.3.5-341.x86_64 2022-05-13 12:27 UTC x86_64 Cygwin Script to reproduce the bug