Merge branch 'fix/type/__sshd_config/error-on-invalid' into 'master'

sshd config: Produce error if invalid config is generated, fix processing of AuthenticationMethods and AuthorizedKeysFile, document explorer bug

See merge request ungleich-public/cdist!968
This commit is contained in:
poljakowski 2021-01-18 06:22:02 +01:00
commit 878a65a8b7
3 changed files with 7 additions and 2 deletions

View file

@ -89,7 +89,7 @@ function strdelim(s) { return strdelim_internal(s, 1) }
function strdelimw(s) { return strdelim_internal(s, 0) } function strdelimw(s) { return strdelim_internal(s, 0) }
function singleton_option(opt) { function singleton_option(opt) {
return tolower(opt) !~ /^(acceptenv|allowgroups|allowusers|authenticationmethods|authorizedkeysfile|denygroups|denyusers|hostcertificate|hostkey|listenaddress|logverbose|permitlisten|permitopen|port|setenv|subsystem)$/ return tolower(opt) !~ /^(acceptenv|allowgroups|allowusers|denygroups|denyusers|hostcertificate|hostkey|listenaddress|logverbose|permitlisten|permitopen|port|setenv|subsystem)$/
} }
function print_update() { function print_update() {

View file

@ -91,7 +91,8 @@ awk $(drop_awk_comments "${__type:?}/files/update_sshd_config.awk") \\
cmp -s $(quote "${sshd_config_file}") $(quote "${sshd_config_file}.tmp") || { cmp -s $(quote "${sshd_config_file}") $(quote "${sshd_config_file}.tmp") || {
sshd -t -f $(quote "${sshd_config_file}.tmp") \\ sshd -t -f $(quote "${sshd_config_file}.tmp") \\
&& cat $(quote "${sshd_config_file}.tmp") >$(quote "${sshd_config_file}") && cat $(quote "${sshd_config_file}.tmp") >$(quote "${sshd_config_file}") \\
|| exit # stop if sshd_config file check fails
} }
rm -f $(quote "${sshd_config_file}.tmp") rm -f $(quote "${sshd_config_file}.tmp")
EOF EOF

View file

@ -79,6 +79,10 @@ BUGS
- ``Include`` directives are ignored. - ``Include`` directives are ignored.
- Config options are not added/removed to/from the config file if their value is - Config options are not added/removed to/from the config file if their value is
the default value. the default value.
- | The explorer will incorrectly report ``absent`` if OpenSSH internally
transforms one value to another (e.g. ``permitrootlogin prohibit-password``
is transformed to ``permitrootlogin without-password``).
| Workaround: Use the value that OpenSSH uses internally.
AUTHORS AUTHORS