mirror of
https://github.com/systemd/systemd.git
synced 2024-12-12 03:33:44 +08:00
core: drop implicit support of PrivateTmp=off
Follow-up for 0e551b04ef
.
Similar to the previous commit, but for PrivateTmp=.
This commit is contained in:
parent
edd3f4d9b7
commit
2e8a581b9c
@ -1023,7 +1023,7 @@ static int property_get_private_tmp(
|
||||
sd_bus_error *error) {
|
||||
|
||||
PrivateTmp *p = ASSERT_PTR(userdata);
|
||||
int b = *p != PRIVATE_TMP_OFF;
|
||||
int b = *p != PRIVATE_TMP_NO;
|
||||
|
||||
return sd_bus_message_append_basic(reply, 'b', &b);
|
||||
}
|
||||
@ -1847,7 +1847,7 @@ int bus_exec_context_set_transient_property(
|
||||
return r;
|
||||
|
||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
||||
c->private_tmp = v ? PRIVATE_TMP_CONNECTED : PRIVATE_TMP_OFF;
|
||||
c->private_tmp = v ? PRIVATE_TMP_CONNECTED : PRIVATE_TMP_NO;
|
||||
(void) unit_write_settingf(u, flags, name, "%s=%s", name, yes_no(v));
|
||||
}
|
||||
|
||||
|
@ -3852,7 +3852,7 @@ static bool exec_context_need_unprivileged_private_users(
|
||||
return false;
|
||||
|
||||
return context->private_users != PRIVATE_USERS_NO ||
|
||||
context->private_tmp != PRIVATE_TMP_OFF ||
|
||||
context->private_tmp != PRIVATE_TMP_NO ||
|
||||
context->private_devices ||
|
||||
context->private_network ||
|
||||
context->network_namespace_path ||
|
||||
|
@ -3221,7 +3221,7 @@ static const char* const proc_subset_table[_PROC_SUBSET_MAX] = {
|
||||
DEFINE_STRING_TABLE_LOOKUP(proc_subset, ProcSubset);
|
||||
|
||||
static const char* const private_tmp_table[_PRIVATE_TMP_MAX] = {
|
||||
[PRIVATE_TMP_OFF] = "off",
|
||||
[PRIVATE_TMP_NO] = "no",
|
||||
[PRIVATE_TMP_CONNECTED] = "connected",
|
||||
[PRIVATE_TMP_DISCONNECTED] = "disconnected",
|
||||
};
|
||||
|
@ -54,7 +54,7 @@ typedef enum ProcSubset {
|
||||
} ProcSubset;
|
||||
|
||||
typedef enum PrivateTmp {
|
||||
PRIVATE_TMP_OFF,
|
||||
PRIVATE_TMP_NO,
|
||||
PRIVATE_TMP_CONNECTED, /* Bind mounted from the host's filesystem */
|
||||
PRIVATE_TMP_DISCONNECTED, /* A completely private tmpfs, invisible from the host */
|
||||
_PRIVATE_TMP_MAX,
|
||||
|
@ -4305,7 +4305,7 @@ int unit_patch_contexts(Unit *u) {
|
||||
/* With DynamicUser= we want private directories, so if the user hasn't manually
|
||||
* selected PrivateTmp=, enable it, but to a fully private (disconnected) tmpfs
|
||||
* instance. */
|
||||
if (ec->private_tmp == PRIVATE_TMP_OFF)
|
||||
if (ec->private_tmp == PRIVATE_TMP_NO)
|
||||
ec->private_tmp = PRIVATE_TMP_DISCONNECTED;
|
||||
ec->remove_ipc = true;
|
||||
ec->protect_system = PROTECT_SYSTEM_STRICT;
|
||||
|
Loading…
Reference in New Issue
Block a user