chiark / gitweb /
tests: add tests for environment serialization
[elogind.git] / src / basic / rm-rf.c
index 85854acf9f0c05f535a05e7acb9807b2a3f5c0ca..156366c7d1487f419697d7ae3808829ccfd1b578 100644 (file)
@@ -27,6 +27,7 @@
 
 //#include "btrfs-util.h"
 #include "cgroup-util.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "log.h"
 #include "macro.h"
@@ -183,7 +184,7 @@ int rm_rf(const char *path, RemoveFlags flags) {
         /* We refuse to clean the root file system with this
          * call. This is extra paranoia to never cause a really
          * seriously broken system. */
-        if (path_equal(path, "/")) {
+        if (path_equal_or_files_same(path, "/", AT_SYMLINK_NOFOLLOW)) {
                 log_error("Attempted to remove entire root file system, and we can't allow that.");
                 return -EPERM;
         }