mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
libsystemd: add new type SD_PATH_SEARCH_SYSCTL for sd_path_lookup*
Add the new type SD_PATH_SEARCH_SYSCTL to libsystemd.
With this new type sd_path_lookup() and sd_path_lookup_strv() will
return the paths used by systemd-sysctl(1) to search the .conf files:
/etc/sysctl.d/
/run/sysctl.d/
/usr/local/lib/sysctl.d/
/usr/lib/sysctl.d/
Refer to sysctl.d(5) man page.
Note: the old type SD_PATH_SYSCTL is still available, and returns the
last path (/usr/lib/sysctl.d/).
This commit is contained in:
@@ -76,6 +76,7 @@
|
||||
<constant>SD_PATH_SEARCH_CONFIGURATION_FACTORY</constant>,
|
||||
<constant>SD_PATH_SEARCH_STATE_FACTORY</constant>,
|
||||
<constant>SD_PATH_SEARCH_CONFIGURATION</constant>,
|
||||
<constant>SD_PATH_SEARCH_SYSCTL</constant>,
|
||||
|
||||
<constant>SD_PATH_SYSTEMD_UTIL</constant>,
|
||||
<constant>SD_PATH_SYSTEMD_SYSTEM_UNIT</constant>,
|
||||
|
||||
@@ -683,7 +683,11 @@ static int get_search(uint64_t type, char ***ret) {
|
||||
|
||||
*ret = TAKE_PTR(l);
|
||||
return 0;
|
||||
}}
|
||||
}
|
||||
|
||||
case SD_PATH_SEARCH_SYSCTL:
|
||||
return strv_from_nulstr(ret, CONF_PATHS_NULSTR("sysctl.d"));
|
||||
}
|
||||
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
@@ -129,6 +129,8 @@ __extension__ enum {
|
||||
SD_PATH_USER_CREDENTIAL_STORE_ENCRYPTED,
|
||||
SD_PATH_USER_SEARCH_CREDENTIAL_STORE_ENCRYPTED,
|
||||
|
||||
SD_PATH_SEARCH_SYSCTL,
|
||||
|
||||
_SD_PATH_MAX,
|
||||
_SD_PATH_INVALID = UINT64_MAX
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user