summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-09 17:30:22 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-09 17:30:22 +0200
commit461b1822321d6be0d7fd8be29bf3b4993ebd1b85 (patch)
tree34c4d6423ed74c0f03ba206818827c86cec219a6 /src/shared
parent8401e9f91d65c3d8d49cf0d2e35d03146354e957 (diff)
paranoia: refuse rm_rf("/")
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 041a63bb4b..41505b2ca7 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3339,6 +3339,9 @@ int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky
assert(path);
+ /* Be paranoid */
+ assert(!streq(path, "/"));
+
fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
if (fd < 0) {