Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #53994 #56731

Merged
merged 3 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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