3 ms·
This reminds me of a bug I ran into in some beta software on Windows many years ago: 1. Create the directory "C:\APPNAME-tmp" 2. Change the current directory
by cperciva 7y ago
This reminds me of a bug I ran into in some beta software on Windows many years ago:
1. Create the directory "C:\APPNAME-tmp"
2. Change the current directory to "C:\APPNAME-tmp"
3. Recursively delete everything under the current directory.
This worked fine for thousands of users until I came along -- running Windows 2000, with the "C:\" directory read-only for unprivileged users, running as an unprivileged user. At that point it became:
1. Try, and fail, to create the directory "C:\APPNAME-tmp"
2. Try, and fail, to change the current directory to "C:\APPNAME-tmp"
3. Recursively delete everything under the current directory, which is my home directory.
The authors were very apologetic when I pointed out the bug.
- maxyme 7y agoThe Steam Linux client had a very similar issue a few years ago where in certain configurations it would delete / https://github.com/ValveSoftware/steam-for-linux/issues/3671 https://github.com/ValveSoftware/steam-for-linux/issues/3671
- noisy_boy 7y agoThis has been a big fear for me - its why in my scripts, I obsessively check whether I am where I should be after a cd before I try any changes. Has saved my back many times.
- pyhtel 7y agoOh man, I did something similar once. Folder with customer files also had a temp folder that needed cleaning, so I wrote a program that went into the temp folder and deleted everything recursively. For some reason, the temp folder had a folder named ".." (no reason how anyone managed to create that). So I ran the script, and upon hitting the ".." folder, it started deleting regular customer files. Good times...