]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/home/homed-conf.c
conf: replace config_parse_many_nulstr() with config_parse_config_file()
[thirdparty/systemd.git] / src / home / homed-conf.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3 #include "conf-parser.h"
4 #include "constants.h"
5 #include "home-util.h"
6 #include "homed-conf.h"
7
8 int manager_parse_config_file(Manager *m) {
9
10 assert(m);
11
12 return config_parse_config_file("homed.conf", "Home\0",
13 config_item_perf_lookup, homed_gperf_lookup,
14 CONFIG_PARSE_WARN, m);
15 }
16
17 DEFINE_CONFIG_PARSE_ENUM(config_parse_default_storage, user_storage, UserStorage, "Failed to parse default storage setting");
18
19 int config_parse_default_file_system_type(
20 const char *unit,
21 const char *filename,
22 unsigned line,
23 const char *section,
24 unsigned section_line,
25 const char *lvalue,
26 int ltype,
27 const char *rvalue,
28 void *data,
29 void *userdata) {
30
31 char **s = ASSERT_PTR(data);
32
33 assert(rvalue);
34
35 if (!isempty(rvalue) && !supported_fstype(rvalue)) {
36 log_syntax(unit, LOG_WARNING, filename, line, 0, "Unsupported file system, ignoring: %s", rvalue);
37 return 0;
38 }
39
40 return free_and_strdup_warn(s, empty_to_null(rvalue));
41
42 }