ssh-generator: follow symlink when searching for sshd@.service
unit_file_exists() currently does not follow symlinks, as it is mainly used to test whether the unit (of any install state) has been seen under search dirs. However, in ssh-generator we should search for and honor whatever the distro ships, which might be an alias or linked externally.
This commit is contained in:
@@ -181,9 +181,15 @@ int unit_file_lookup_state(
|
||||
|
||||
int unit_file_get_state(RuntimeScope scope, const char *root_dir, const char *filename, UnitFileState *ret);
|
||||
|
||||
int unit_file_exists_full(RuntimeScope scope, const LookupPaths *lp, const char *name, char **ret_path);
|
||||
int unit_file_exists_full(
|
||||
RuntimeScope scope,
|
||||
const LookupPaths *lp,
|
||||
bool follow,
|
||||
const char *name,
|
||||
char **ret_path);
|
||||
|
||||
static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *lp, const char *name) {
|
||||
return unit_file_exists_full(scope, lp, name, NULL);
|
||||
return unit_file_exists_full(scope, lp, false, name, NULL);
|
||||
}
|
||||
|
||||
int unit_file_get_list(RuntimeScope scope, const char *root_dir, char * const *states, char * const *patterns, Hashmap **ret);
|
||||
|
||||
Reference in New Issue
Block a user