diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-11-10 23:18:34 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-11-10 23:18:34 +0100 |
commit | 6ee5bbf85ce18cf07269a674d96f3a1d0ec7bf6b (patch) | |
tree | c475b19109f937b710602bfdd6a6249074d42224 /src | |
parent | 42bb3074fe9632d7aa0fee825ad30d2083c3c629 (diff) |
main: warn if /etc/mtab is not a symlink
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index ea2f0c1a9e..71e684b1bd 100644 --- a/src/main.c +++ b/src/main.c @@ -890,6 +890,24 @@ static struct dual_timestamp* parse_initrd_timestamp(struct dual_timestamp *t) { return t; } +static void test_mtab(void) { + char *p; + + if (readlink_malloc("/etc/mtab", &p) >= 0) { + bool b; + + b = streq(p, "/proc/self/mounts"); + free(p); + + if (b) + return; + } + + log_error("/etc/mtab is not a symlink or not pointing to /proc/self/mounts. " + "This is not supported anymore. " + "Please make sure to replace this file by a symlink to avoid incorrect or misleading mount(8) output."); +} + int main(int argc, char *argv[]) { Manager *m = NULL; int r, retval = EXIT_FAILURE; @@ -1048,6 +1066,8 @@ int main(int argc, char *argv[]) { loopback_setup(); mkdir_p("/dev/.systemd/ask-password/", 0755); + + test_mtab(); } if ((r = manager_new(arg_running_as, &m)) < 0) { |