mirror of
https://github.com/systemd/systemd
synced 2025-11-22 02:04:45 +01:00
Compare commits
No commits in common. "dbcbe4aa0488ce130d574ef1a6d457045eac0bbb" and "463f0a027a6a6a842bd026979a9aeb841c732bb1" have entirely different histories.
dbcbe4aa04
...
463f0a027a
@ -52,13 +52,12 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para><function>udev_enumerate_new()</function> creates an enumeration context to scan
|
<para><function>udev_enumerate_new()</function> creates an enumeration context to scan /sys.</para>
|
||||||
<filename>/sys/</filename>.</para>
|
|
||||||
|
|
||||||
<para><function>udev_enumerate_ref()</function> takes a reference of an enumeration context.</para>
|
<para><function>udev_enumerate_ref()</function> takes a reference of an enumeration context.</para>
|
||||||
|
|
||||||
<para><function>udev_enumerate_unref()</function> drops a reference of an enumeration context. If the
|
<para><function>udev_enumerate_unref()</function> drops a reference of an enumeration context. If the refcount reaches zero,
|
||||||
refcount reaches zero, all resources of the enumeration context will be released.</para>
|
all resources of the enumeration context will be released.</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
|||||||
@ -1454,6 +1454,12 @@ static void set_io_weight(Unit *u, uint64_t weight) {
|
|||||||
(void) set_attribute_and_warn(u, "io.weight", buf);
|
(void) set_attribute_and_warn(u, "io.weight", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void cgroup_apply_bpf_foreign_program(Unit *u) {
|
||||||
|
assert(u);
|
||||||
|
|
||||||
|
(void) bpf_foreign_install(u);
|
||||||
|
}
|
||||||
|
|
||||||
static void cgroup_context_apply(
|
static void cgroup_context_apply(
|
||||||
Unit *u,
|
Unit *u,
|
||||||
CGroupMask apply_mask,
|
CGroupMask apply_mask,
|
||||||
@ -1603,7 +1609,7 @@ static void cgroup_context_apply(
|
|||||||
cgroup_apply_firewall(u);
|
cgroup_apply_firewall(u);
|
||||||
|
|
||||||
if (apply_mask & CGROUP_MASK_BPF_FOREIGN)
|
if (apply_mask & CGROUP_MASK_BPF_FOREIGN)
|
||||||
(void) bpf_foreign_install(u);
|
cgroup_apply_bpf_foreign_program(u);
|
||||||
|
|
||||||
if (apply_mask & CGROUP_MASK_BPF_SOCKET_BIND)
|
if (apply_mask & CGROUP_MASK_BPF_SOCKET_BIND)
|
||||||
cgroup_apply_socket_bind(u);
|
cgroup_apply_socket_bind(u);
|
||||||
|
|||||||
@ -425,6 +425,9 @@ static int manager_varlink_init_system(Manager *m) {
|
|||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
|
if (!MANAGER_IS_SYSTEM(m))
|
||||||
|
return 0;
|
||||||
|
|
||||||
r = manager_setup_varlink_server(m);
|
r = manager_setup_varlink_server(m);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to set up varlink server: %m");
|
return log_error_errno(r, "Failed to set up varlink server: %m");
|
||||||
@ -453,6 +456,9 @@ static int manager_varlink_init_user(Manager *m) {
|
|||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
|
if (!MANAGER_IS_USER(m))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (MANAGER_IS_TEST_RUN(m))
|
if (MANAGER_IS_TEST_RUN(m))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@ -161,7 +161,7 @@ static int generator_add_ordering(
|
|||||||
assert(order);
|
assert(order);
|
||||||
assert(dst);
|
assert(dst);
|
||||||
|
|
||||||
/* Adds an explicit ordering dependency of type <order> from <src> to <dst>. If <instance> is
|
/* Adds in an explicit ordering dependency of type <order> from <src> to <dst>. If <instance> is
|
||||||
* specified, it is inserted into <dst>. */
|
* specified, it is inserted into <dst>. */
|
||||||
|
|
||||||
if (instance) {
|
if (instance) {
|
||||||
|
|||||||
@ -1183,15 +1183,7 @@ static int start_tpm(
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to find swtpm_setup binary: %m");
|
return log_error_errno(r, "Failed to find swtpm_setup binary: %m");
|
||||||
|
|
||||||
/* Try passing --profile-name default-v2 first, in order to support RSA4096 pcrsig keys, which was
|
_cleanup_strv_free_ char **argv = strv_new(swtpm_setup, "--tpm-state", state_dir, "--tpm2", "--pcr-banks", "sha256", "--not-overwrite");
|
||||||
* added in 0.11. */
|
|
||||||
_cleanup_strv_free_ char **argv = strv_new(
|
|
||||||
swtpm_setup,
|
|
||||||
"--tpm-state", state_dir,
|
|
||||||
"--tpm2",
|
|
||||||
"--pcr-banks", "sha256",
|
|
||||||
"--not-overwrite",
|
|
||||||
"--profile-name", "default-v2");
|
|
||||||
if (!argv)
|
if (!argv)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
@ -1202,22 +1194,6 @@ static int start_tpm(
|
|||||||
log_error_errno(errno, "Failed to execute '%s': %m", argv[0]);
|
log_error_errno(errno, "Failed to execute '%s': %m", argv[0]);
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (r == -EPROTO) {
|
|
||||||
/* If swtpm_setup fails, try again removing the default-v2 profile, as it might be an older
|
|
||||||
* version. */
|
|
||||||
strv_remove(argv, "--profile-name");
|
|
||||||
strv_remove(argv, "default-v2");
|
|
||||||
|
|
||||||
r = safe_fork("(swtpm-setup)", FORK_CLOSE_ALL_FDS|FORK_LOG|FORK_WAIT, NULL);
|
|
||||||
if (r == 0) {
|
|
||||||
/* Child */
|
|
||||||
execvp(argv[0], argv);
|
|
||||||
log_error_errno(errno, "Failed to execute '%s': %m", argv[0]);
|
|
||||||
_exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (r < 0)
|
|
||||||
return log_error_errno(r, "Failed to run swtpm_setup: %m");
|
|
||||||
|
|
||||||
strv_free(argv);
|
strv_free(argv);
|
||||||
argv = strv_new(sd_socket_activate, "--listen", listen_address, swtpm, "socket", "--tpm2", "--tpmstate");
|
argv = strv_new(sd_socket_activate, "--listen", listen_address, swtpm, "socket", "--tpm2", "--tpmstate");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user