nspawn: apply BindUser/Ephemeral from settings file only if trusted
Originally reported on yeswehack.com as: YWH-PGM9780-116 Follow-up for2f89304490Follow-up fora2f577fca0
This commit is contained in:
+14
-4
@@ -4783,8 +4783,13 @@ static int merge_settings(Settings *settings, const char *path) {
|
||||
}
|
||||
|
||||
if ((arg_settings_mask & SETTING_EPHEMERAL) == 0 &&
|
||||
settings->ephemeral >= 0)
|
||||
arg_ephemeral = settings->ephemeral;
|
||||
settings->ephemeral >= 0) {
|
||||
|
||||
if (!arg_settings_trusted)
|
||||
log_warning("Ignoring ephemeral setting, file %s is not trusted.", path);
|
||||
else
|
||||
arg_ephemeral = settings->ephemeral;
|
||||
}
|
||||
|
||||
if ((arg_settings_mask & SETTING_DIRECTORY) == 0 &&
|
||||
settings->root) {
|
||||
@@ -4953,8 +4958,13 @@ static int merge_settings(Settings *settings, const char *path) {
|
||||
}
|
||||
|
||||
if ((arg_settings_mask & SETTING_BIND_USER) == 0 &&
|
||||
!strv_isempty(settings->bind_user))
|
||||
strv_free_and_replace(arg_bind_user, settings->bind_user);
|
||||
!strv_isempty(settings->bind_user)) {
|
||||
|
||||
if (!arg_settings_trusted)
|
||||
log_warning("Ignoring bind user setting, file %s is not trusted.", path);
|
||||
else
|
||||
strv_free_and_replace(arg_bind_user, settings->bind_user);
|
||||
}
|
||||
|
||||
if (!FLAGS_SET(arg_settings_mask, SETTING_BIND_USER_SHELL) &&
|
||||
settings->bind_user_shell_set) {
|
||||
|
||||
Reference in New Issue
Block a user