Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
tmpfiles: R! /dir/.* destroys root #5644
Comments
jsynacek
changed the title from
tmpfxles: R! /dir/.* destroys root
to
tmpfiles: R! /dir/.* destroys root
Mar 27, 2017
added a commit
to jsynacek/systemd
that referenced
this issue
Mar 28, 2017
jsynacek
referenced this issue
Mar 28, 2017
Merged
basic: forbid rm_rf() to remove paths ending with ".." #5653
martinpitt
closed this
in
#5653
Mar 29, 2017
added a commit
that referenced
this issue
Mar 29, 2017
|
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? |
|
No, not on Fedora 24 at least. |
louiz
commented
Apr 7, 2017
No http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html#tag_20_111_16
|
csirac2
commented
Apr 16, 2017
•
|
Here's the regression tests in coreutils https://github.com/coreutils/coreutils/blob/e7a2580b96370da03c4d3553ccdf4ee66a14c6a4/tests/rm/r-4.sh#L39 which includes the |
rysiekpl
commented
Apr 17, 2017
|
For some people it's advisable to never miss a chance to stay silent. Debian:
Ubuntu:
Busybox:
It took a whole of 5mins to test all of these. I find it particularly interesting since the comment I am referring to has been made after the issue has been solved already. Way to highlight how little consideration is being given to issues reported by |
thelounge-zz
commented
Apr 17, 2017
shocking to hear
no, and you REALLY should know that as many others do or AT LEAST test it before pretend such nonsense - frankly, that below is not something theoretical, i do that for many years to get /tmp/ really empty [root@testserver:/tmp]$ rm -rf . |
thelounge-zz
commented
Apr 17, 2017
|
and look how others see it as "much of a problem" when something by accident kills the whole OS - and yes i am terrible angry by that comment which shows something of an bad attitude [root@testserver:~]$ rm -rf / |
jsynacek commentedMar 27, 2017
•
Edited 1 time
-
jsynacek
Mar 27, 2017
Do NOT run the reproducer without a proper backup and/or on a production system!
How to reproduce:
# mkdir -p /foo/dir{1,2}# touch /foo/.bar{1,2}# cat /etc/tmpfiles.d/test.confR! /foo/.* - - - - -Note the dot in the glob. When either using r!, or removing the dot and using R!, the bug doesn't reproduce.