Skip to content

Commit

Permalink
Do not allow empty values to enter login.defs cfa model. bsc#1208492
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Feb 22, 2023
1 parent e0a2d13 commit 3a47235
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/Security.rb
Expand Up @@ -554,6 +554,11 @@ def write_to_locations
# Write login.defs configuration
def write_shadow_config
SHADOW_ATTRS.each do |attr|
# bsc#1208492 shadow config uses login.defs attr formatting
# like <Key><space>*<Value>, so empty value is not supported
# and moreover can cause crash in login.defs lens
next if @Settings[attr].nil? || @Settings[attr].empty?

shadow_config.public_send("#{attr.to_s.downcase}=", @Settings[attr])
end
encr = @Settings.fetch("PASSWD_ENCRYPTION", default_encrypt_method)
Expand Down

0 comments on commit 3a47235

Please sign in to comment.