News for hackers. Stuff that matters.
Re:I shipped a word processor that formatted the hard drive ... by cperciva on Saturday May 02, 2020 @08:46PM (#23056035)
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.

Re:I shipped a word processor that formatted the hard drive ... by maxyme on Saturday May 02, 2020 @11:05PM (#23056588)
The 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
Re:I shipped a word processor that formatted the hard drive ... by pyhtel on Monday May 04, 2020 @04:05AM (#23065590)
Oh 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...
Re:I shipped a word processor that formatted the hard drive ... by noisy_boy on Monday May 04, 2020 @02:46AM (#23065224)
This 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.