summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/automount.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/automount.c b/src/automount.c
index b5003b3a75..26fec45107 100644
--- a/src/automount.c
+++ b/src/automount.c
@@ -154,6 +154,11 @@ static int automount_verify(Automount *a) {
if (a->meta.load_state != UNIT_LOADED)
return 0;
+ if (path_equal(a->where, "/")) {
+ log_error("Cannot have an automount unit for the root directory. Refusing.");
+ return -EINVAL;
+ }
+
if (!(e = unit_name_from_path(a->where, ".automount")))
return -ENOMEM;