1
0
mirror of https://github.com/systemd/systemd synced 2024-07-01 07:34:28 +00:00

core/namespace: add assertion for PRIVATE_TMP_CONNECTED

This commit is contained in:
Mike Yuan 2024-06-18 16:14:46 +02:00
parent 335b14ade5
commit d7f24848ba
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -2314,7 +2314,10 @@ int setup_namespace(const NamespaceParameters *p, char **error_path) {
.source_dir_mode = 01777,
.create_source_dir = true,
};
} else {
} else if (p->tmp_dir || p->var_tmp_dir) {
assert(p->private_tmp == PRIVATE_TMP_CONNECTED);
if (p->tmp_dir) {
bool ro = streq(p->tmp_dir, RUN_SYSTEMD_EMPTY);