On Fri, Jun 24, 2022 at 02:35:19PM +0100, mick crane wrote: > On 2022-06-24 08:37, Thomas Schmitt wrote: > <snipped>> After "rm -rf /" one probably has to re-install the system first, > > Once upon a time one of the distributions put you in / > after "su" > where typing "rm -rf ./*" is not the best thing to do. > "Noooooooo"
Add this to the long list of grievances against the change to su in Debian buster. I believe you were actually using "su -" on the offending distribution, because said distribution's "su" command did not correctly set the PATH variable. Said distribution might have been Red Hat, or some derivative thereof. In any case, it was one where root's home directory was / instead of /root. The Red Hat community seems to have fully embraced the "su -" workaround to their terrible su command, to the point where it started to bleed out into the general Linux community. When Debian switched to the horrible su command in buster, and users were shocked and appalled by the changed behavior, they reached out for answers, and found "su -" waiting for them, fresh out of the Red Hat hell which had spawned it. As you have observed here, the worst side effect of "su -" is that it changes your directory. Whatever you were going to become root to do, now you have to find your way *back* to the directory you were in previously, before you can do it. In most cases, this is merely an annoyance, albeit a severe one (since you're in a whole new shell, you can't just use "cd -" or $OLDPWD). In the case of rm, it can lead to the actual loss of data, if you forget that you have been moved. <https://wiki.debian.org/NewInBuster#Changes> gives a list of ways you can work around the problem. It is abundantly clear by now that Debian is not going to fix the problems they caused by the switch, so you will just have to fix them yourself. It can be as simple as creating a one-line config file.