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 (also in the tar):

#!/bin/bash
echo 'EVERY FILE IN THE CURRENT WORKING DIRECTORY WILL BE DELETED!'
read -p "Enter 'sure' to continue: " var
echo $var | grep -q sure || exit 1

do_stuff ()
{
    mkdir foo
    touch Foo.lnk
    if [ -d foo ]; then
        rm -rf foo
    fi
}
do_stuff
do_stuff
# All files in the current working directory are now GONE!

Attachment: delete-all-files.tar
Description: Unix tar archive

Attachment: OpenPGP_0x473CD05C78734E49.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to