salt
salt copied to clipboard
wip: archive.extrated fixes
What does this PR do?
Fixes three small issues with archive.extrated state.
Previous Behavior
- Cleanup would not happen if clean_parent was set.
- top directory was created without setting the group
- ownership enforcement could be applied against root directory - "/"
Clarification regarding 1.
clean and clean_parent are mutually exclusive parameters. When clean_parent was added that part of the logic was missed.
Clarification regarding 2.
Top directory creation only considers owner archive.extracted parameter and ignores group. We can argue if it's a bugfix or new feature, but it's a bugfix from my PoV. Minions usually run from the root user and archive.extracted top directory will always have a root group - seems wrong.
Clarification regarding 3.
$ ls -la
total 0
drwxr-xr-x 3 oloremo wheel 96 Feb 23 11:03 .
drwxrwxrwt 23 root wheel 736 Feb 23 11:03 ..
-rw-r--r-- 1 oloremo wheel 0 Feb 23 10:54 file1
$ tar -czvf /tmp/no_top_level.tgz .
./
./file1
$ tar -tvf /tmp/no_top_level.tgz
drwxr-xr-x oloremo/wheel 0 2022-02-23 11:03 ./
-rw-r--r-- oloremo/wheel 0 2022-02-23 10:54 ./file1
New Behavior
- Cleanup will be triggered with either clean or clean_parent params set.
- top directory creation takes group into account
- ownership enforcement will never be applied against the root directory
Merge requirements satisfied?
- [ ] Docs
- [x] Changelog - https://docs.saltproject.io/en/master/topics/development/changelog.html
- [ ] Tests written/updated
Commits signed with GPG?
Yes