public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Deleting a directory with the same name as a shortcut deletes everything in CWD
@ 2022-08-08 10:50 Oskar Skog
  2022-08-08 11:56 ` Christian Franke
  0 siblings, 1 reply; 6+ messages in thread
From: Oskar Skog @ 2022-08-08 10:50 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1.1: Type: text/plain, Size: 676 bytes --]

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 #1.1.2: delete-all-files.tar --]
[-- Type: application/x-tar, Size: 10240 bytes --]

[-- Attachment #1.1.3: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2485 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 665 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-09 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08 10:50 Deleting a directory with the same name as a shortcut deletes everything in CWD Oskar Skog
2022-08-08 11:56 ` Christian Franke
2022-08-08 23:29   ` Ken Brown
2022-08-09 19:52     ` Ken Brown
2022-08-09 20:01       ` Oskar Skog
2022-08-09 20:11         ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).