Lines Matching refs:parameter

59 Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate) {  in condition_new()  argument
64 assert(parameter); in condition_new()
76 if (parameter) { in condition_new()
77 c->parameter = strdup(parameter); in condition_new()
78 if (!c->parameter) in condition_new()
88 free(c->parameter); in condition_free()
110 assert(c->parameter); in condition_test_kernel_command_line()
117 equal = strchr(c->parameter, '='); in condition_test_kernel_command_line()
130 found = streq(word, c->parameter); in condition_test_kernel_command_line()
134 f = startswith(word, c->parameter); in condition_test_kernel_command_line()
219 assert(c->parameter); in condition_test_kernel_version()
224 p = c->parameter; in condition_test_kernel_version()
271 const char *parameter = c->parameter; in condition_test_osrelease() local
275 assert(c->parameter); in condition_test_osrelease()
284 r = extract_first_word(&parameter, &condition, NULL, EXTRACT_UNQUOTE); in condition_test_osrelease()
332 assert(c->parameter); in condition_test_memory()
337 p = c->parameter; in condition_test_memory()
356 assert(c->parameter); in condition_test_cpus()
363 p = c->parameter; in condition_test_cpus()
382 assert(c->parameter); in condition_test_user()
385 r = parse_uid(c->parameter, &id); in condition_test_user()
389 if (streq("@system", c->parameter)) in condition_test_user()
396 if (streq(username, c->parameter)) in condition_test_user()
400 return streq(c->parameter, "root"); in condition_test_user()
402 u = c->parameter; in condition_test_user()
415 assert(c->parameter); in condition_test_control_group_controller()
418 if (streq(c->parameter, "v2")) in condition_test_control_group_controller()
420 if (streq(c->parameter, "v1")) { in condition_test_control_group_controller()
431 r = cg_mask_from_string(c->parameter, &wanted_mask); in condition_test_control_group_controller()
436 log_debug("Failed to parse cgroup string: %s", c->parameter); in condition_test_control_group_controller()
448 assert(c->parameter); in condition_test_group()
451 r = parse_gid(c->parameter, &id); in condition_test_group()
457 return streq(c->parameter, "root"); in condition_test_group()
459 return in_group(c->parameter) > 0; in condition_test_group()
467 assert(c->parameter); in condition_test_virtualization()
470 if (streq(c->parameter, "private-users")) in condition_test_virtualization()
478 b = parse_boolean(c->parameter); in condition_test_virtualization()
483 if (streq(c->parameter, "vm")) in condition_test_virtualization()
486 if (streq(c->parameter, "container")) in condition_test_virtualization()
490 return v != VIRTUALIZATION_NONE && streq(c->parameter, virtualization_to_string(v)); in condition_test_virtualization()
497 assert(c->parameter); in condition_test_architecture()
504 if (streq(c->parameter, "native")) in condition_test_architecture()
507 b = architecture_from_string(c->parameter); in condition_test_architecture()
554 assert(c->parameter); in condition_test_firmware()
557 if (streq(c->parameter, "device-tree")) { in condition_test_firmware()
564 } else if ((dtc = startswith(c->parameter, "device-tree-compatible("))) { in condition_test_firmware()
570 log_debug("Malformed Firmware condition \"%s\"", c->parameter); in condition_test_firmware()
579 } else if (streq(c->parameter, "uefi")) in condition_test_firmware()
582 log_debug("Unsupported Firmware condition \"%s\"", c->parameter); in condition_test_firmware()
593 assert(c->parameter); in condition_test_host()
596 if (sd_id128_from_string(c->parameter, &x) >= 0) { in condition_test_host()
609 return fnmatch(c->parameter, h, FNM_CASEFOLD) == 0; in condition_test_host()
616 assert(c->parameter); in condition_test_ac_power()
619 r = parse_boolean(c->parameter); in condition_test_ac_power()
639 assert(c->parameter); in condition_test_security()
642 if (streq(c->parameter, "selinux")) in condition_test_security()
644 if (streq(c->parameter, "smack")) in condition_test_security()
646 if (streq(c->parameter, "apparmor")) in condition_test_security()
648 if (streq(c->parameter, "audit")) in condition_test_security()
650 if (streq(c->parameter, "ima")) in condition_test_security()
652 if (streq(c->parameter, "tomoyo")) in condition_test_security()
654 if (streq(c->parameter, "uefi-secureboot")) in condition_test_security()
656 if (streq(c->parameter, "tpm2")) in condition_test_security()
668 assert(c->parameter); in condition_test_capability()
672 value = capability_from_name(c->parameter); in condition_test_capability()
712 assert(c->parameter); in condition_test_needs_update()
726 if (!path_is_absolute(c->parameter)) { in condition_test_needs_update()
727 …"Specified condition parameter '%s' is not absolute, assuming an update is needed.", c->parameter); in condition_test_needs_update()
732 r = path_is_read_only_fs(c->parameter); in condition_test_needs_update()
734 … log_debug_errno(r, "Failed to determine if '%s' is read-only, ignoring: %m", c->parameter); in condition_test_needs_update()
741 p = strjoina(c->parameter, "/.updated"); in condition_test_needs_update()
796 assert(c->parameter); in condition_test_first_boot()
805 r = parse_boolean(c->parameter); in condition_test_first_boot()
820 assert(c->parameter); in condition_test_environment()
823 equal = strchr(c->parameter, '='); in condition_test_environment()
829 found = streq(c->parameter, *i); in condition_test_environment()
833 f = startswith(*i, c->parameter); in condition_test_environment()
846 assert(c->parameter); in condition_test_path_exists()
849 return access(c->parameter, F_OK) >= 0; in condition_test_path_exists()
854 assert(c->parameter); in condition_test_path_exists_glob()
857 return glob_exists(c->parameter) > 0; in condition_test_path_exists_glob()
862 assert(c->parameter); in condition_test_path_is_directory()
865 return is_dir(c->parameter, true) > 0; in condition_test_path_is_directory()
870 assert(c->parameter); in condition_test_path_is_symbolic_link()
873 return is_symlink(c->parameter) > 0; in condition_test_path_is_symbolic_link()
878 assert(c->parameter); in condition_test_path_is_mount_point()
881 return path_is_mount_point(c->parameter, NULL, AT_SYMLINK_FOLLOW) > 0; in condition_test_path_is_mount_point()
888 assert(c->parameter); in condition_test_path_is_read_write()
891 r = path_is_read_only_fs(c->parameter); in condition_test_path_is_read_write()
898 assert(c->parameter); in condition_test_cpufeature()
901 return has_cpu_with_flag(ascii_strlower(c->parameter)); in condition_test_cpufeature()
908 assert(c->parameter); in condition_test_path_is_encrypted()
911 r = path_is_encrypted(c->parameter); in condition_test_path_is_encrypted()
913 log_debug_errno(r, "Failed to determine if '%s' is encrypted: %m", c->parameter); in condition_test_path_is_encrypted()
922 assert(c->parameter); in condition_test_directory_not_empty()
925 r = dir_is_empty(c->parameter, /* ignore_hidden_or_backup= */ true); in condition_test_directory_not_empty()
933 assert(c->parameter); in condition_test_file_not_empty()
936 return (stat(c->parameter, &st) >= 0 && in condition_test_file_not_empty()
945 assert(c->parameter); in condition_test_file_is_executable()
948 return (stat(c->parameter, &st) >= 0 && in condition_test_file_is_executable()
961 assert(c->parameter); in condition_test_psi()
973 p = c->parameter; in condition_test_psi()
976 …o(r < 0 ? r : SYNTHETIC_ERRNO(EINVAL), "Failed to parse condition parameter %s: %m", c->parameter); in condition_test_psi()
996 …g_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to parse condition parameter %s: %m", c->parameter); in condition_test_psi()
1051 …o(r < 0 ? r : SYNTHETIC_ERRNO(EINVAL), "Failed to parse condition parameter %s: %m", c->parameter); in condition_test_psi()
1059 …g_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to parse condition parameter %s: %m", c->parameter); in condition_test_psi()
1068 …g_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to parse condition parameter %s: %m", c->parameter); in condition_test_psi()
1073 …g_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to parse condition parameter %s: %m", c->parameter); in condition_test_psi()
1077 return log_debug_errno(r, "Failed to parse permyriad: %s", c->parameter); in condition_test_psi()
1081 return log_debug_errno(r, "Failed to parse loadavg: %s", c->parameter); in condition_test_psi()
1182 c->parameter); in condition_test_list()
1189 c->parameter, in condition_test_list()
1216 c->parameter, in condition_dump()