Skip to content

Commit

Permalink
Merge pull request #56731 from twangboy/backport_53994
Browse files Browse the repository at this point in the history
Backport #53994
  • Loading branch information
dwoz authored Apr 22, 2020
2 parents e3e5797 + b9dbff9 commit 85db45c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Versions are `MAJOR.PATCH`.
### Deprecated

### Changed

- [#56731](https://github.com/saltstack/salt/pull/56731) - Backport #53994
- [#56753](https://github.com/saltstack/salt/pull/56753) - Backport 51095

### Fixed
Expand Down
15 changes: 9 additions & 6 deletions tests/unit/daemons/test_masterapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def test_check_permissions_others_can_write(self):
@patch_check_permissions()
def test_check_permissions_group_can_write_not_permissive(self):
"""
Assert that a file is accepted, when group can write to it and perkissive_pki_access=False
Assert that a file is accepted, when group can write to it and
permissive_pki_access=False
"""
self.stats["testfile"] = {"mode": gen_permissions("w", "w", ""), "gid": 1}
if salt.utils.platform.is_windows():
Expand All @@ -116,25 +117,27 @@ def test_check_permissions_group_can_write_not_permissive(self):
@patch_check_permissions(permissive_pki=True)
def test_check_permissions_group_can_write_permissive(self):
"""
Assert that a file is accepted, when group can write to it and perkissive_pki_access=True
Assert that a file is accepted, when group can write to it and
permissive_pki_access=True
"""
self.stats["testfile"] = {"mode": gen_permissions("w", "w", ""), "gid": 1}
self.assertTrue(self.auto_key.check_permissions("testfile"))

@patch_check_permissions(uid=0, permissive_pki=True)
def test_check_permissions_group_can_write_permissive_root_in_group(self):
"""
Assert that a file is accepted, when group can write to it, perkissive_pki_access=False,
salt is root and in the file owning group
Assert that a file is accepted, when group can write to it,
permissive_pki_access=False, salt is root and in the file owning group
"""
self.stats["testfile"] = {"mode": gen_permissions("w", "w", ""), "gid": 0}
self.assertTrue(self.auto_key.check_permissions("testfile"))

@patch_check_permissions(uid=0, permissive_pki=True)
def test_check_permissions_group_can_write_permissive_root_not_in_group(self):
"""
Assert that no file is accepted, when group can write to it, perkissive_pki_access=False,
salt is root and **not** in the file owning group
Assert that no file is accepted, when group can write to it,
permissive_pki_access=False, salt is root and **not** in the file owning
group
"""
self.stats["testfile"] = {"mode": gen_permissions("w", "w", ""), "gid": 1}
if salt.utils.platform.is_windows():
Expand Down

0 comments on commit 85db45c

Please sign in to comment.