['systemd-socket-activate', '1', [], ''],
['systemd-socket-proxyd', '8', [], ''],
['systemd-soft-reboot.service', '8', [], ''],
+ ['systemd-ssh-generator', '8', [], ''],
+ ['systemd-ssh-proxy', '1', [], ''],
['systemd-stdio-bridge', '1', [], ''],
['systemd-storagetm.service', '8', ['systemd-storagetm'], 'ENABLE_STORAGETM'],
['systemd-stub',
['timesyncd.conf', '5', ['timesyncd.conf.d'], 'ENABLE_TIMESYNCD'],
['tmpfiles.d', '5', [], ''],
['udev', '7', [], ''],
- ['udev.conf', '5', [], ''],
+ ['udev.conf', '5', ['udev.conf.d'], ''],
['udev_device_get_syspath',
'3',
['udev_device_get_action',
return 0;
}
- /* Parse one main config file located in /etc/systemd and its drop-ins, which is what all systemd daemons
+ /* Parse one main config file located in /etc/$pkgdir and its drop-ins, which is what all systemd daemons
* do. */
- int config_parse_config_file(
+ int config_parse_config_file_full(
const char *conf_file,
+ const char *pkgdir,
const char *sections,
ConfigItemLookup lookup,
const void *table,
int r;
assert(conf_file);
+ assert(pkgdir);
/* build the dropin dir list */
dropin_dirs = new0(char*, strv_length(conf_paths) + 1);
STRV_FOREACH(p, conf_paths) {
char *d;
- d = strjoin(*p, "systemd/", conf_file, ".d");
+ d = strjoin(*p, pkgdir, "/", conf_file, ".d");
if (!d) {
if (flags & CONFIG_PARSE_WARN)
return log_oom();
if (r < 0)
return r;
- const char *sysconf_file = strjoina(PKGSYSCONFDIR, "/", conf_file);
+ const char *sysconf_file = strjoina(SYSCONF_DIR, "/", pkgdir, "/", conf_file);
return config_parse_many_files(STRV_MAKE_CONST(sysconf_file), dropins,
sections, lookup, table, flags, userdata, NULL);
return true;
}
-static void config_section_hash_func(const ConfigSection *c, struct siphash *state) {
+void config_section_hash_func(const ConfigSection *c, struct siphash *state) {
siphash24_compress_string(c->filename, state);
siphash24_compress_typesafe(c->line, state);
}
-static int config_section_compare_func(const ConfigSection *x, const ConfigSection *y) {
+int config_section_compare_func(const ConfigSection *x, const ConfigSection *y) {
int r;
r = strcmp(x->filename, y->filename);
void *userdata) {
char **s = ASSERT_PTR(data);
+ int r;
assert(filename);
assert(lvalue);
if (isempty(rvalue)) {
*s = mfree(*s);
- return 0;
+ return 1;
}
if (FLAGS_SET(ltype, CONFIG_PARSE_STRING_SAFE) && !string_is_safe(rvalue)) {
return 0;
}
- return free_and_strdup_warn(s, empty_to_null(rvalue));
+ r = free_and_strdup_warn(s, empty_to_null(rvalue));
+ if (r < 0)
+ return r;
+
+ return 1;
}
int config_parse_dns_name(
void *userdata,
struct stat *ret_stat); /* possibly NULL */
- int config_parse_config_file(
+ int config_parse_config_file_full(
const char *conf_file,
+ const char *pkgdir,
const char *sections, /* nulstr */
ConfigItemLookup lookup,
const void *table,
ConfigParseFlags flags,
void *userdata);
+ static inline int config_parse_config_file(
+ const char *conf_file,
+ const char *sections, /* nulstr */
+ ConfigItemLookup lookup,
+ const void *table,
+ ConfigParseFlags flags,
+ void *userdata) {
+ return config_parse_config_file_full(conf_file, "systemd", sections, lookup, table, flags, userdata);
+ }
+
int config_parse_many(
const char* const* conf_files, /* possibly empty */
const char* const* conf_file_dirs,
DEFINE_TRIVIAL_CLEANUP_FUNC(ConfigSection*, config_section_free);
int config_section_new(const char *filename, unsigned line, ConfigSection **ret);
+
+void config_section_hash_func(const ConfigSection *c, struct siphash *state);
+int config_section_compare_func(const ConfigSection *x, const ConfigSection *y);
extern const struct hash_ops config_section_hash_ops;
+
int _hashmap_by_section_find_unused_line(
HashmapBase *entries_by_section,
const char *filename,