2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2020-05-05 09:57:04 +02:00
|
|
|
|
|
|
|
#include "conf-parser.h"
|
|
|
|
#include "def.h"
|
|
|
|
#include "home-util.h"
|
|
|
|
#include "homed-conf.h"
|
|
|
|
|
|
|
|
int manager_parse_config_file(Manager *m) {
|
|
|
|
int r;
|
|
|
|
|
|
|
|
assert(m);
|
|
|
|
|
2020-06-02 14:55:12 +02:00
|
|
|
r = config_parse_many_nulstr(
|
|
|
|
PKGSYSCONFDIR "/homed.conf",
|
|
|
|
CONF_PATHS_NULSTR("systemd/homed.conf.d"),
|
|
|
|
"Home\0",
|
|
|
|
config_item_perf_lookup, homed_gperf_lookup,
|
|
|
|
CONFIG_PARSE_WARN,
|
|
|
|
m,
|
|
|
|
NULL);
|
2020-05-05 09:57:04 +02:00
|
|
|
if (r < 0)
|
|
|
|
return r;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFINE_CONFIG_PARSE_ENUM(config_parse_default_storage, user_storage, UserStorage, "Failed to parse default storage setting");
|
|
|
|
|
|
|
|
int 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) {
|
|
|
|
|
|
|
|
char **s = data;
|
|
|
|
|
|
|
|
assert(rvalue);
|
|
|
|
assert(s);
|
|
|
|
|
|
|
|
if (!isempty(rvalue) && !supported_fstype(rvalue)) {
|
2020-09-10 08:21:43 +02:00
|
|
|
log_syntax(unit, LOG_WARNING, filename, line, 0, "Unsupported file system, ignoring: %s", rvalue);
|
2020-05-05 09:57:04 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return free_and_strdup_warn(s, empty_to_null(rvalue));
|
|
|
|
|
|
|
|
}
|