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