Skip to content

Commit e192b1e

Browse files
authored
Merge pull request #70 from mcgege/os-02
os-02: Fix for SUSE environments
2 parents b13f83b + c310414 commit e192b1e

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

controls/os_spec.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@
2121
login_defs_passmaxdays = attribute('login_defs_passmaxdays', default: '60', description: 'Default password maxdays to set in login.defs')
2222
login_defs_passmindays = attribute('login_defs_passmindays', default: '7', description: 'Default password mindays to set in login.defs')
2323
login_defs_passwarnage = attribute('login_defs_passwarnage', default: '7', description: 'Default password warnage (days) to set in login.defs')
24-
if os.redhat?
25-
shadow_group = 'root'
26-
elsif os.debian?
27-
shadow_group = 'shadow'
28-
end
24+
shadow_group = 'root'
25+
shadow_group = 'shadow' if os.debian? || os.suse?
2926
blacklist = attribute(
3027
'blacklist',
3128
default: [
@@ -99,13 +96,13 @@
9996
it { should be_readable.by('owner') }
10097
it { should_not be_readable.by('other') }
10198
end
102-
if os.redhat?
99+
if os.debian? || os.suse?
103100
describe file('/etc/shadow') do
104-
it { should_not be_readable.by('group') }
101+
it { should be_readable.by('group') }
105102
end
106-
elsif os.debian?
103+
else
107104
describe file('/etc/shadow') do
108-
it { should be_readable.by('group') }
105+
it { should_not be_readable.by('group') }
109106
end
110107
end
111108
end

0 commit comments

Comments
 (0)