summaryrefslogtreecommitdiff
path: root/src/login/logind.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-24 19:53:16 -0300
committerLennart Poettering <lennart@poettering.net>2013-04-25 00:05:14 -0300
commitdb5c0122853a9ecf1cc92e6593461932df2fa866 (patch)
tree45f2cca6a0050dfa36ecb08af64d974ec4542ea5 /src/login/logind.c
parent60b6991a4dd687097bbc4f1e1ef7585efee079d9 (diff)
conf-parser: restrict .include usage
Disallow recursive .include, and make it unavailable in anything but unit files.
Diffstat (limited to 'src/login/logind.c')
-rw-r--r--src/login/logind.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index 536612cbd2..5a394401dc 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1683,13 +1683,12 @@ int manager_run(Manager *m) {
}
static int manager_parse_config_file(Manager *m) {
- FILE *f;
- const char *fn;
+ static const char fn[] = "/etc/systemd/logind.conf";
+ _cleanup_fclose_ FILE *f = NULL;
int r;
assert(m);
- fn = "/etc/systemd/logind.conf";
f = fopen(fn, "re");
if (!f) {
if (errno == ENOENT)
@@ -1699,12 +1698,11 @@ static int manager_parse_config_file(Manager *m) {
return -errno;
}
- r = config_parse(NULL, fn, f, "Login\0", config_item_perf_lookup, (void*) logind_gperf_lookup, false, m);
+ r = config_parse(NULL, fn, f, "Login\0", config_item_perf_lookup,
+ (void*) logind_gperf_lookup, false, false, m);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
- fclose(f);
-
return r;
}