Edit: The link.
There were lots of good titles for this submission, as in "Breaking news: Poettering clueless?" to finally disprove Betteridge's law, or "systemd surprisingly not as good as advertised" or "Breaking new: systemd broken" or "Poettering censors critics after epic fail".
Systemd implementation of "rm -rf .*" will follow ".." to upper directory and erase /
How to reproduce:
# mkdir -p /foo/dir{1,2}
# touch /foo/.bar{1,2}
# cat /etc/tmpfiles.d/test.conf
R! /foo/.* - - - - -
Reboot.
After the issue was fixed, finally Poettering added this gem of wisdom:
I am not sure I'd consider this much of a problem. Yeah, it's a UNIX pitfall, but "rm -rf /foo/.*" will work the exact same way, no?
The answer to this question, as many clarified for him, obviously is a loud "NO!". After being told a couple of times in no uncertain terms, the thread was closed for non-developers
poettering locked and limited conversation to collaborators 4 hours ago
for which I proposed the "freedom-of-speech" department (although I admit it is a weak proposal).
(Score: 5, Insightful) by maxwell demon on Monday April 17 2017, @09:29PM (17 children)
My first thought when reading the title was: Why on earth does an init system need its own implementation of rm?
But then, this is systemd, the Borg init system. Probably I should be astonished if something has not yet been affected by it.
The Tao of math: The numbers you can count are not the real numbers.
(Score: 3, Interesting) by Azuma Hazuki on Monday April 17 2017, @09:34PM (5 children)
> My first thought when reading the title was: Why on earth does an init system need its own implementation of rm?
Mine too. This went from "WTF?" to feeling deeply, deeply unclean and doomed, something like I imagine you'd feel if someone told you that 5 years ago you'd had a blood transplant that turned out to have syphilis in it...
I am "that girl" your mother warned you about...
(Score: 2) by FatPhil on Tuesday April 18 2017, @07:55AM (4 children)
(Just for reference, it's "blood transfusion" not transplant, transplants are for solid bits.)
Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
(Score: 0) by Anonymous Coward on Tuesday April 18 2017, @11:54AM
Maybe it was clotted.
(Score: 2) by Azuma Hazuki on Tuesday April 18 2017, @01:53PM (2 children)
Good point...I meant to type transfusion, but haven't been sleeping properly for months so...yeah. And I would be a little wary of Devuan; at this point you may as well go full-on FreeBSD or Gentoo if you have the hardware for it. I am beginning to wonder if at some point around 2019 or 2020 Gentoo, Slackware, etc will fork off and call themselves something different, maybe even maintaining their own Linux kernel without the creeping systemd hooks...
I am "that girl" your mother warned you about...
(Score: 2) by FatPhil on Tuesday April 18 2017, @02:14PM (1 child)
Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
(Score: 2) by tibman on Tuesday April 18 2017, @05:04PM
I've had good success with melatonin as well. Using some random gummi brand from amazon.
SN won't survive on lurkers alone. Write comments.
(Score: 2, Informative) by Anonymous Coward on Monday April 17 2017, @10:05PM (4 children)
My first thought when reading the title was: Why on earth does an init system need its own implementation of rm?
It does not have its own rm. It has an internal command called R! that calls a function called rm_rf().
It is right there in the summary.
This whole story is a big bag of nothing hyped by people who don't know what they are talking about.
The fact that there was no link to the github issue in the submission should have been a clue to the editors that it was low-grade crap.
(Score: 3, Touché) by cubancigar11 on Tuesday April 18 2017, @05:45AM (2 children)
And does rm_rf() call rm -rf or does it try to implement it internally?
(Score: 0) by Anonymous Coward on Tuesday April 18 2017, @03:14PM (1 child)
What do you think? If it called the system rm would this bug report ever have been opened?
I don't get it, why are you hung up on the name of the function call?
Its like people are so amped up to bag on poettering that you all are willing to lose your shit over tiniiest thing.
Ermagad somebody on the internet made a dumb comment!
Should you be judged by every dumbass comment you've made?
(Score: 2) by cubancigar11 on Wednesday April 19 2017, @03:17AM
I have no interest in the name I am talking about duplicating functionality and breaking it - which is basically the biggest problem everyone has with systemd and poettring.
Seriously, systemd is GPLv2 and there are enough version of coreutils in GPLv2 to not implement it again.
(Score: 2, Touché) by Anonymous Coward on Tuesday April 18 2017, @06:35AM
Thank you, Lennart, for joining our discussion and setting us straight. You're right- "rm -rf /" is a great way to clean up tons of crap on a Linux filesystem. Way better than bleachbit.
(Score: 2) by NotSanguine on Tuesday April 18 2017, @02:32AM (2 children)
My first thought when reading the title was: Why on earth does an init system need its own implementation of rm?
But then, this is systemd, the Borg init system. Probably I should be astonished if something has not yet been affected by it.
The "functionality" in question is part of systemd-tmpfiles(8) [fordham.edu]:
No, no, you're not thinking; you're just being logical. --Niels Bohr
(Score: 0) by Anonymous Coward on Tuesday April 18 2017, @02:33PM (1 child)
Given that it is meant to handle files and directories inside one or two special directories, it is really surprising that the commands are not only run as root, but allowed to exit those directories.
One would think that making use of a special config file format rather than shell scripts and core utils for this was to avoid just such events happening...
(Score: 2) by NotSanguine on Tuesday April 18 2017, @05:04PM
IIUC, there is functionality which allows the use of functions from systemd-tmpfiles in a systemd pseudo-shell. a command within that pseudo-shell (R!) purported to mimic 'rm -rf' but the function didn't treat '.' and '..' (as /bin/rm does) as special cases, making sure that deletions only occurred downwards in the directory tree.
I suppose one could make the argument that only careless users would go with 'R! .*'. However, given that /bin/rm had mitigated that issue for a number of years, (not sure when, but as a novice user back in the late 80s/early 90s I made that mistake with rm and it happily deleted half my root filesystem before I realized what was happening) by refusing to delete up the directory tree.
As such, refusing to delete up the tree is (and has been for some time) the expected behavior, so that argument is pretty weak.
Poettering, et al showed a glaring lack of common sense in their implementation and didn't consider edge cases.
No, no, you're not thinking; you're just being logical. --Niels Bohr
(Score: 2) by Alphatool on Tuesday April 18 2017, @11:16AM (1 child)
Well, from a systemd point of view you've got this backwards! Why should the operating system have a duplicated implementation of rm when there can be a perfectly good one built into the init system?? It's even better at deleting things than the legacy implementation was!! Next up, twitter integration!!!
(Score: 3, Funny) by maxwell demon on Tuesday April 18 2017, @06:38PM
I'm looking forward to the binary twitter messages. ;-)
The Tao of math: The numbers you can count are not the real numbers.
(Score: 2) by digitalaudiorock on Tuesday April 18 2017, @08:11PM
Nothing surprises me (or anyone with two brain cells to rub together) at all about any of this, nor do the requisite troll apologists putting their $.02 in the comments here. Anyone defending what we're seeing here is being paid by someone or is simply a fucking idiot.
It's been clear since day one the the intentional approach of the systemd devs, unlike the entire history of unix and Linux is basically is to NOT reuse anything prior, and to re-invent every possible wheel...because you know..."how difficult could it be?" and "what do a bunch of fucking old grey-beards know?". I guess they're starting to find out right? Arrogant know-it-all jackasses at work. Thank God for my systemd-less Gentoo systems.