systemd-path: allow the default search path to be queried
This commit is contained in:
@@ -348,6 +348,7 @@ _public_ int sd_path_home(uint64_t type, const char *suffix, char **path) {
|
||||
|
||||
if (IN_SET(type,
|
||||
SD_PATH_SEARCH_BINARIES,
|
||||
SD_PATH_SEARCH_BINARIES_DEFAULT,
|
||||
SD_PATH_SEARCH_LIBRARY_PRIVATE,
|
||||
SD_PATH_SEARCH_LIBRARY_ARCH,
|
||||
SD_PATH_SEARCH_SHARED,
|
||||
@@ -566,7 +567,17 @@ static int get_search(uint64_t type, char ***list) {
|
||||
false,
|
||||
"/etc",
|
||||
NULL);
|
||||
}
|
||||
|
||||
case SD_PATH_SEARCH_BINARIES_DEFAULT: {
|
||||
char **t;
|
||||
|
||||
t = strv_split_nulstr(DEFAULT_PATH_NULSTR);
|
||||
if (!t)
|
||||
return -ENOMEM;
|
||||
|
||||
*list = t;
|
||||
return 0;
|
||||
}}
|
||||
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
@@ -579,6 +590,7 @@ _public_ int sd_path_search(uint64_t type, const char *suffix, char ***paths) {
|
||||
|
||||
if (!IN_SET(type,
|
||||
SD_PATH_SEARCH_BINARIES,
|
||||
SD_PATH_SEARCH_BINARIES_DEFAULT,
|
||||
SD_PATH_SEARCH_LIBRARY_PRIVATE,
|
||||
SD_PATH_SEARCH_LIBRARY_ARCH,
|
||||
SD_PATH_SEARCH_SHARED,
|
||||
|
||||
Reference in New Issue
Block a user