Skip to content

Commit

Permalink
reading the right param in the banner text file instead of just globb…
Browse files Browse the repository at this point in the history
…ing all the contents

Signed-off-by: wdower <[email protected]>
  • Loading branch information
wdower committed Feb 29, 2024
1 parent 5fba2cc commit 605909d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controls/SV-238198.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,16 @@
tag nist: ['AC-8 a']
tag 'host', 'container'

banner_text = input('banner_text')
clean_banner = banner_text.gsub(/[\r\n\s]/, '')
expected_banner_text = input('banner_text')
clean_banner = expected_banner_text.gsub(/[\r\n\s]/, '')
gdm3_defaults_file = input('gdm3_config_file')

actual_banner_text = parse_config_file('/etc/gdm3/greeter.dconf-defaults').params['org/gnome/login-screen']['banner-message-text']
clean_actual_banner = actual_banner_text.gsub(/[\r\n\s]/, '')

if package('gdm3').installed?
describe 'The SSHD Banner is set to the standard banner and has the correct text' do
subject { file(gdm3_defaults_file).content.gsub(/[\r\n\s]/, '') }
subject { clean_actual_banner }
it { should cmp clean_banner }
end
else
Expand Down

0 comments on commit 605909d

Please sign in to comment.