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