summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-10 02:41:25 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-10 02:41:25 +0200
commit41e450596adebf7f74e4a7e66c1d0466ea4e323c (patch)
tree4d90489159da025484dd0d631b614e501c298735
parent4e67ddd6b39c2847cc399ab0874427baa7ea8935 (diff)
automount: refuse automounts for the root file system
-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;