pamd: fix idempotence issue when removing rules (#54105)
This commit is contained in:
parent
f405d97e1e
commit
bcdd1dc951
3 changed files with 5 additions and 1 deletions
2
changelogs/fragments/pamd-make-idempotence-fix.yaml
Normal file
2
changelogs/fragments/pamd-make-idempotence-fix.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- pamd - fix idempotence issue when removing rules
|
|
@ -349,5 +349,7 @@ session required pam_unix.so"""
|
||||||
|
|
||||||
def test_remove_rule(self):
|
def test_remove_rule(self):
|
||||||
self.assertTrue(self.pamd.remove('account', 'required', 'pam_unix.so'))
|
self.assertTrue(self.pamd.remove('account', 'required', 'pam_unix.so'))
|
||||||
|
# Second run should not change anything
|
||||||
|
self.assertFalse(self.pamd.remove('account', 'required', 'pam_unix.so'))
|
||||||
test_rule = PamdRule('account', 'required', 'pam_unix.so')
|
test_rule = PamdRule('account', 'required', 'pam_unix.so')
|
||||||
self.assertNotIn(str(test_rule), str(self.pamd))
|
self.assertNotIn(str(test_rule), str(self.pamd))
|
||||||
|
|
Loading…
Reference in a new issue