mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
condition: pass runtime scope to condition tests
The next commit makes condition behaviour differ between the system and per-user service managers, so condition tests need to know which scope they evaluate for. Pass the `RuntimeScope` through `condition_test()` and `condition_test_list()` and adjust all callers: - the service manager and `systemd-analyze condition` pass their scope - systemd-sysupdate is system-only - networkd and udevd are no service managers and pass no scope No behaviour change. Signed-off-by: Martin Pitt <martin@amutable.com>
This commit is contained in:
1 parent
cf8ebfc615
commit
284ee7ea66
7 files changed
+328
-319
No files matched your search
@@ -125,11 +125,11 @@ static int verify_conditions(char **lines, RuntimeScope scope, const char *unit,
|
||||
}
|
||||
|
||||
condition_test_logger_t logger = arg_quiet ? NULL : log_helper;
|
||||
r = condition_test_list(u->asserts, environ, assert_type_to_string, logger, u) > 0;
|
||||
r = condition_test_list(u->asserts, environ, scope, assert_type_to_string, logger, u) > 0;
|
||||
if (u->asserts)
|
||||
log_full(arg_quiet ? LOG_DEBUG : LOG_NOTICE, "Asserts %s.", r > 0 ? "succeeded" : "failed");
|
||||
|
||||
q = condition_test_list(u->conditions, environ, condition_type_to_string, logger, u) > 0;
|
||||
q = condition_test_list(u->conditions, environ, scope, condition_type_to_string, logger, u) > 0;
|
||||
if (u->conditions)
|
||||
log_full(arg_quiet ? LOG_DEBUG : LOG_NOTICE, "Conditions %s.", q > 0 ? "succeeded" : "failed");
|
||||
|
||||
|
||||
@@ -1817,6 +1817,7 @@ static bool unit_test_condition(Unit *u) {
|
||||
u->condition_result = condition_test_list(
|
||||
u->conditions,
|
||||
env,
|
||||
u->manager->runtime_scope,
|
||||
condition_type_to_string,
|
||||
log_unit_internal,
|
||||
u) > 0;
|
||||
@@ -1841,6 +1842,7 @@ static bool unit_test_assert(Unit *u) {
|
||||
u->assert_result = condition_test_list(
|
||||
u->asserts,
|
||||
env,
|
||||
u->manager->runtime_scope,
|
||||
assert_type_to_string,
|
||||
log_unit_internal,
|
||||
u) > 0;
|
||||
|
||||
+49
-45
@@ -54,6 +54,7 @@
|
||||
#include "proc-cmdline.h"
|
||||
#include "process-util.h"
|
||||
#include "psi-util.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "selinux-util.h"
|
||||
#include "smack-util.h"
|
||||
#include "special.h"
|
||||
@@ -111,7 +112,7 @@ Condition* condition_free_list_type(Condition *head, ConditionType type) {
|
||||
return head;
|
||||
}
|
||||
|
||||
static int condition_test_kernel_command_line(Condition *c, char **env) {
|
||||
static int condition_test_kernel_command_line(Condition *c, char **env, RuntimeScope scope) {
|
||||
_cleanup_strv_free_ char **args = NULL;
|
||||
int r;
|
||||
|
||||
@@ -144,7 +145,7 @@ static int condition_test_kernel_command_line(Condition *c, char **env) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static int condition_test_credential(Condition *c, char **env) {
|
||||
static int condition_test_credential(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -235,7 +236,7 @@ static int condition_test_version_cmp(const char *condition, const char *ver) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static int condition_test_version(Condition *c, char **env) {
|
||||
static int condition_test_version(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -269,7 +270,7 @@ static int condition_test_version(Condition *c, char **env) {
|
||||
return condition_test_version_cmp(p, u.release);
|
||||
}
|
||||
|
||||
static int condition_test_osrelease(Condition *c, char **env) {
|
||||
static int condition_test_osrelease(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -318,7 +319,7 @@ static int condition_test_osrelease(Condition *c, char **env) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static int condition_test_machine_tag(Condition *c, char **env) {
|
||||
static int condition_test_machine_tag(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -349,7 +350,7 @@ static int condition_test_machine_tag(Condition *c, char **env) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static int condition_test_memory(Condition *c, char **env) {
|
||||
static int condition_test_memory(Condition *c, char **env, RuntimeScope scope) {
|
||||
CompareOperator operator;
|
||||
uint64_t m, k;
|
||||
const char *p;
|
||||
@@ -373,7 +374,7 @@ static int condition_test_memory(Condition *c, char **env) {
|
||||
return test_order(CMP(m, k), operator);
|
||||
}
|
||||
|
||||
static int condition_test_cpus(Condition *c, char **env) {
|
||||
static int condition_test_cpus(Condition *c, char **env, RuntimeScope scope) {
|
||||
CompareOperator operator;
|
||||
const char *p;
|
||||
unsigned k;
|
||||
@@ -399,7 +400,7 @@ static int condition_test_cpus(Condition *c, char **env) {
|
||||
return test_order(CMP((unsigned) n, k), operator);
|
||||
}
|
||||
|
||||
static int condition_test_user(Condition *c, char **env) {
|
||||
static int condition_test_user(Condition *c, char **env, RuntimeScope scope) {
|
||||
uid_t id;
|
||||
int r;
|
||||
|
||||
@@ -438,7 +439,7 @@ static int condition_test_user(Condition *c, char **env) {
|
||||
return id == getuid() || id == geteuid();
|
||||
}
|
||||
|
||||
static int condition_test_control_group_controller(Condition *c, char **env) {
|
||||
static int condition_test_control_group_controller(Condition *c, char **env, RuntimeScope scope) {
|
||||
CGroupMask system_mask, wanted_mask;
|
||||
int r;
|
||||
|
||||
@@ -467,7 +468,7 @@ static int condition_test_control_group_controller(Condition *c, char **env) {
|
||||
return FLAGS_SET(system_mask, wanted_mask);
|
||||
}
|
||||
|
||||
static int condition_test_group(Condition *c, char **env) {
|
||||
static int condition_test_group(Condition *c, char **env, RuntimeScope scope) {
|
||||
gid_t id;
|
||||
int r;
|
||||
|
||||
@@ -486,7 +487,7 @@ static int condition_test_group(Condition *c, char **env) {
|
||||
return in_group(c->parameter) > 0;
|
||||
}
|
||||
|
||||
static int condition_test_virtualization(Condition *c, char **env) {
|
||||
static int condition_test_virtualization(Condition *c, char **env, RuntimeScope scope) {
|
||||
Virtualization v;
|
||||
int b;
|
||||
|
||||
@@ -537,7 +538,7 @@ static int condition_test_architecture_parameter(const char *parameter) {
|
||||
return a == b;
|
||||
}
|
||||
|
||||
static int condition_test_architecture(Condition *c, char **env) {
|
||||
static int condition_test_architecture(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_ARCHITECTURE);
|
||||
@@ -629,7 +630,7 @@ static int condition_test_firmware_smbios_field(const char *expression) {
|
||||
return version_or_fnmatch_compare(operator, actual_value, expected_value);
|
||||
}
|
||||
|
||||
static int condition_test_firmware(Condition *c, char **env) {
|
||||
static int condition_test_firmware(Condition *c, char **env, RuntimeScope scope) {
|
||||
sd_char *arg;
|
||||
int r;
|
||||
|
||||
@@ -683,7 +684,7 @@ static int condition_test_firmware(Condition *c, char **env) {
|
||||
}
|
||||
}
|
||||
|
||||
static int condition_test_host(Condition *c, char **env) {
|
||||
static int condition_test_host(Condition *c, char **env, RuntimeScope scope) {
|
||||
_cleanup_free_ char *h = NULL;
|
||||
int r;
|
||||
|
||||
@@ -743,7 +744,7 @@ static uint32_t condition_fraction_value(sd_id128_t machine_id, const char *text
|
||||
return unaligned_read_le32(res);
|
||||
}
|
||||
|
||||
static int condition_test_fraction(Condition *c, char **env) {
|
||||
static int condition_test_fraction(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -806,7 +807,7 @@ static int condition_test_fraction(Condition *c, char **env) {
|
||||
return condition_fraction_value(mid, text) < UINT32_SCALE_FROM_PERMYRIAD(permyriad);
|
||||
}
|
||||
|
||||
static int condition_test_ac_power(Condition *c, char **env) {
|
||||
static int condition_test_ac_power(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -830,7 +831,7 @@ static int has_tpm2(void) {
|
||||
return FLAGS_SET(tpm2_support_full(TPM2_SUPPORT_SUBSYSTEM|TPM2_SUPPORT_FIRMWARE), TPM2_SUPPORT_SUBSYSTEM|TPM2_SUPPORT_FIRMWARE);
|
||||
}
|
||||
|
||||
static int condition_test_security(Condition *c, char **env) {
|
||||
static int condition_test_security(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_SECURITY);
|
||||
@@ -861,7 +862,7 @@ static int condition_test_security(Condition *c, char **env) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static int condition_test_capability(Condition *c, char **env) {
|
||||
static int condition_test_capability(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -881,7 +882,7 @@ static int condition_test_capability(Condition *c, char **env) {
|
||||
return BIT_SET(q.bounding, value);
|
||||
}
|
||||
|
||||
static int condition_test_needs_update(Condition *c, char **env) {
|
||||
static int condition_test_needs_update(Condition *c, char **env, RuntimeScope scope) {
|
||||
struct stat usr, other;
|
||||
const char *p;
|
||||
bool b;
|
||||
@@ -967,7 +968,7 @@ static int condition_test_needs_update(Condition *c, char **env) {
|
||||
return timespec_load_nsec(&usr.st_mtim) > timestamp;
|
||||
}
|
||||
|
||||
static int condition_test_first_boot(Condition *c, char **env) {
|
||||
static int condition_test_first_boot(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -984,7 +985,7 @@ static int condition_test_first_boot(Condition *c, char **env) {
|
||||
return (in_first_boot() > 0) == r;
|
||||
}
|
||||
|
||||
static int condition_test_environment(Condition *c, char **env) {
|
||||
static int condition_test_environment(Condition *c, char **env, RuntimeScope scope) {
|
||||
bool equal;
|
||||
|
||||
assert(c);
|
||||
@@ -1012,7 +1013,7 @@ static int condition_test_environment(Condition *c, char **env) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static int condition_test_path_exists(Condition *c, char **env) {
|
||||
static int condition_test_path_exists(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_PATH_EXISTS);
|
||||
@@ -1020,7 +1021,7 @@ static int condition_test_path_exists(Condition *c, char **env) {
|
||||
return access(c->parameter, F_OK) >= 0;
|
||||
}
|
||||
|
||||
static int condition_test_path_exists_glob(Condition *c, char **env) {
|
||||
static int condition_test_path_exists_glob(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_PATH_EXISTS_GLOB);
|
||||
@@ -1028,7 +1029,7 @@ static int condition_test_path_exists_glob(Condition *c, char **env) {
|
||||
return glob_exists(c->parameter) > 0;
|
||||
}
|
||||
|
||||
static int condition_test_path_is_directory(Condition *c, char **env) {
|
||||
static int condition_test_path_is_directory(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_PATH_IS_DIRECTORY);
|
||||
@@ -1036,7 +1037,7 @@ static int condition_test_path_is_directory(Condition *c, char **env) {
|
||||
return is_dir(c->parameter, true) > 0;
|
||||
}
|
||||
|
||||
static int condition_test_path_is_symbolic_link(Condition *c, char **env) {
|
||||
static int condition_test_path_is_symbolic_link(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_PATH_IS_SYMBOLIC_LINK);
|
||||
@@ -1044,7 +1045,7 @@ static int condition_test_path_is_symbolic_link(Condition *c, char **env) {
|
||||
return is_symlink(c->parameter) > 0;
|
||||
}
|
||||
|
||||
static int condition_test_path_is_mount_point(Condition *c, char **env) {
|
||||
static int condition_test_path_is_mount_point(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_PATH_IS_MOUNT_POINT);
|
||||
@@ -1052,7 +1053,7 @@ static int condition_test_path_is_mount_point(Condition *c, char **env) {
|
||||
return path_is_mount_point_full(c->parameter, /* root= */ NULL, AT_SYMLINK_FOLLOW) > 0;
|
||||
}
|
||||
|
||||
static int condition_test_path_is_read_write(Condition *c, char **env) {
|
||||
static int condition_test_path_is_read_write(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -1064,7 +1065,7 @@ static int condition_test_path_is_read_write(Condition *c, char **env) {
|
||||
return r <= 0 && r != -ENOENT;
|
||||
}
|
||||
|
||||
static int condition_test_cpufeature(Condition *c, char **env) {
|
||||
static int condition_test_cpufeature(Condition *c, char **env, RuntimeScope scope) {
|
||||
_cleanup_free_ char *cpu_arch = NULL, *feature = NULL;
|
||||
int r;
|
||||
|
||||
@@ -1087,7 +1088,7 @@ static int condition_test_cpufeature(Condition *c, char **env) {
|
||||
return has_cpu_with_flag(ascii_strlower(feature));
|
||||
}
|
||||
|
||||
static int condition_test_path_is_encrypted(Condition *c, char **env) {
|
||||
static int condition_test_path_is_encrypted(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -1101,7 +1102,7 @@ static int condition_test_path_is_encrypted(Condition *c, char **env) {
|
||||
return r > 0;
|
||||
}
|
||||
|
||||
static int condition_test_path_is_socket(Condition *c, char **env) {
|
||||
static int condition_test_path_is_socket(Condition *c, char **env, RuntimeScope scope) {
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_PATH_IS_SOCKET);
|
||||
@@ -1109,7 +1110,7 @@ static int condition_test_path_is_socket(Condition *c, char **env) {
|
||||
return is_socket(c->parameter) > 0;
|
||||
}
|
||||
|
||||
static int condition_test_directory_not_empty(Condition *c, char **env) {
|
||||
static int condition_test_directory_not_empty(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -1120,7 +1121,7 @@ static int condition_test_directory_not_empty(Condition *c, char **env) {
|
||||
return r <= 0 && !IN_SET(r, -ENOENT, -ENOTDIR);
|
||||
}
|
||||
|
||||
static int condition_test_file_not_empty(Condition *c, char **env) {
|
||||
static int condition_test_file_not_empty(Condition *c, char **env, RuntimeScope scope) {
|
||||
struct stat st;
|
||||
|
||||
assert(c);
|
||||
@@ -1132,7 +1133,7 @@ static int condition_test_file_not_empty(Condition *c, char **env) {
|
||||
st.st_size > 0);
|
||||
}
|
||||
|
||||
static int condition_test_file_is_executable(Condition *c, char **env) {
|
||||
static int condition_test_file_is_executable(Condition *c, char **env, RuntimeScope scope) {
|
||||
struct stat st;
|
||||
|
||||
assert(c);
|
||||
@@ -1144,7 +1145,7 @@ static int condition_test_file_is_executable(Condition *c, char **env) {
|
||||
(st.st_mode & 0111));
|
||||
}
|
||||
|
||||
static int condition_test_psi(Condition *c, char **env) {
|
||||
static int condition_test_psi(Condition *c, char **env, RuntimeScope scope) {
|
||||
_cleanup_free_ char *first = NULL, *second = NULL, *third = NULL, *fourth = NULL, *pressure_path = NULL;
|
||||
const char *p, *value, *pressure_type;
|
||||
loadavg_t *current, limit;
|
||||
@@ -1287,7 +1288,7 @@ static int condition_test_psi(Condition *c, char **env) {
|
||||
return *current <= limit;
|
||||
}
|
||||
|
||||
static int condition_test_kernel_module_loaded(Condition *c, char **env) {
|
||||
static int condition_test_kernel_module_loaded(Condition *c, char **env, RuntimeScope scope) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
@@ -1340,9 +1341,9 @@ static int condition_test_kernel_module_loaded(Condition *c, char **env) {
|
||||
return true;
|
||||
}
|
||||
|
||||
typedef int (*condition_test_func_t)(Condition *c, char **env);
|
||||
typedef int (*condition_test_func_t)(Condition *c, char **env, RuntimeScope scope);
|
||||
|
||||
static int condition_test_impl(Condition *c, char **env, const condition_test_func_t table[]) {
|
||||
static int condition_test_impl(Condition *c, char **env, RuntimeScope scope, const condition_test_func_t table[]) {
|
||||
int r, b;
|
||||
|
||||
assert(c);
|
||||
@@ -1351,7 +1352,7 @@ static int condition_test_impl(Condition *c, char **env, const condition_test_fu
|
||||
assert(table);
|
||||
assert(table[c->type]);
|
||||
|
||||
r = table[c->type](c, env);
|
||||
r = table[c->type](c, env, scope);
|
||||
if (r < 0) {
|
||||
c->result = CONDITION_ERROR;
|
||||
return r;
|
||||
@@ -1362,7 +1363,7 @@ static int condition_test_impl(Condition *c, char **env, const condition_test_fu
|
||||
return b;
|
||||
}
|
||||
|
||||
static int condition_test_net(Condition *c, char **env) {
|
||||
static int condition_test_net(Condition *c, char **env, RuntimeScope scope) {
|
||||
static const condition_test_func_t table_net[_CONDITION_TYPE_MAX] = {
|
||||
[CONDITION_KERNEL_COMMAND_LINE] = condition_test_kernel_command_line,
|
||||
[CONDITION_VERSION] = condition_test_version,
|
||||
@@ -1374,10 +1375,10 @@ static int condition_test_net(Condition *c, char **env) {
|
||||
[CONDITION_MACHINE_TAG] = condition_test_machine_tag,
|
||||
};
|
||||
|
||||
return condition_test_impl(c, env, table_net);
|
||||
return condition_test_impl(c, env, scope, table_net);
|
||||
}
|
||||
|
||||
int condition_test(Condition *c, char **env) {
|
||||
int condition_test(Condition *c, char **env, RuntimeScope scope) {
|
||||
static const condition_test_func_t table[_CONDITION_TYPE_MAX] = {
|
||||
[CONDITION_PATH_EXISTS] = condition_test_path_exists,
|
||||
[CONDITION_PATH_EXISTS_GLOB] = condition_test_path_exists_glob,
|
||||
@@ -1418,12 +1419,13 @@ int condition_test(Condition *c, char **env) {
|
||||
[CONDITION_KERNEL_MODULE_LOADED] = condition_test_kernel_module_loaded,
|
||||
};
|
||||
|
||||
return condition_test_impl(c, env, table);
|
||||
return condition_test_impl(c, env, scope, table);
|
||||
}
|
||||
|
||||
static int condition_test_list_impl(
|
||||
Condition *first,
|
||||
char **env,
|
||||
RuntimeScope scope,
|
||||
condition_to_string_t to_string,
|
||||
condition_test_logger_t logger,
|
||||
condition_test_func_t tester,
|
||||
@@ -1444,7 +1446,7 @@ static int condition_test_list_impl(
|
||||
|
||||
has_trigger = has_trigger || c->trigger;
|
||||
|
||||
r = tester(c, env);
|
||||
r = tester(c, env, scope);
|
||||
|
||||
if (logger) {
|
||||
if (r < 0)
|
||||
@@ -1493,17 +1495,19 @@ bool condition_test_list_net(
|
||||
condition_test_logger_t logger,
|
||||
void *userdata) {
|
||||
|
||||
return condition_test_list_impl(first, env, to_string, logger, condition_test_net, userdata) > 0;
|
||||
/* networkd and udevd are not service managers, they have no runtime scope */
|
||||
return condition_test_list_impl(first, env, _RUNTIME_SCOPE_INVALID, to_string, logger, condition_test_net, userdata) > 0;
|
||||
}
|
||||
|
||||
int condition_test_list(
|
||||
Condition *first,
|
||||
char **env,
|
||||
RuntimeScope scope,
|
||||
condition_to_string_t to_string,
|
||||
condition_test_logger_t logger,
|
||||
void *userdata) {
|
||||
|
||||
return condition_test_list_impl(first, env, to_string, logger, condition_test, userdata);
|
||||
return condition_test_list_impl(first, env, scope, to_string, logger, condition_test, userdata);
|
||||
}
|
||||
|
||||
void condition_dump(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string) {
|
||||
|
||||
@@ -81,12 +81,12 @@ static inline Condition* condition_free_list(Condition *first) {
|
||||
return condition_free_list_type(first, _CONDITION_TYPE_INVALID);
|
||||
}
|
||||
|
||||
int condition_test(Condition *c, char **env);
|
||||
int condition_test(Condition *c, char **env, RuntimeScope scope);
|
||||
|
||||
typedef int (*condition_test_logger_t)(void *userdata, int level, int error, const char *file, int line, const char *func, const char *format, ...) _printf_(7, 8);
|
||||
typedef const char* (*condition_to_string_t)(ConditionType t);
|
||||
bool condition_test_list_net(Condition *first, char **env, condition_to_string_t to_string, condition_test_logger_t logger, void *userdata);
|
||||
int condition_test_list(Condition *first, char **env, condition_to_string_t to_string, condition_test_logger_t logger, void *userdata);
|
||||
int condition_test_list(Condition *first, char **env, RuntimeScope scope, condition_to_string_t to_string, condition_test_logger_t logger, void *userdata);
|
||||
|
||||
void condition_dump(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string);
|
||||
void condition_dump_list(Condition *first, FILE *f, const char *prefix, condition_to_string_t to_string);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "hashmap.h"
|
||||
#include "json-util.h"
|
||||
#include "log.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
@@ -88,7 +89,7 @@ int component_is_suggested(const Component *c) {
|
||||
if (!c->suggest_on) /* no condition → false */
|
||||
return false;
|
||||
|
||||
return condition_test_list(c->suggest_on, environ, suggest_on_type_to_string, /* logger= */ NULL, /* userdata= */ NULL);
|
||||
return condition_test_list(c->suggest_on, environ, RUNTIME_SCOPE_SYSTEM, suggest_on_type_to_string, /* logger= */ NULL, /* userdata= */ NULL);
|
||||
}
|
||||
|
||||
static const char* const component_success_action_table[_COMPONENT_SUCCESS_ACTION_MAX] = {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "hash-funcs.h"
|
||||
#include "json-util.h"
|
||||
#include "path-util.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "sysupdate-config.h"
|
||||
@@ -191,5 +192,5 @@ int feature_is_suggested(const Feature *f) {
|
||||
if (!f->suggest_on) /* no condition → false */
|
||||
return false;
|
||||
|
||||
return condition_test_list(f->suggest_on, environ, suggest_on_type_to_string, /* logger= */ NULL, /* userdata= */ NULL);
|
||||
return condition_test_list(f->suggest_on, environ, RUNTIME_SCOPE_SYSTEM, suggest_on_type_to_string, /* logger= */ NULL, /* userdata= */ NULL);
|
||||
}
|
||||
+269
-268
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user