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

tests: Re-enable become/sudo tests, fix them on macOS runners #1168

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

moreati
Copy link
Member

@moreati moreati commented Oct 24, 2024

The tasks in tests/imageprep/_user_accounts.yml that create users did not specify a primary group for those users - this left the decision to Ansible's user module, and/or the underlying OS. In Ansible 9+ (ansible-core 2.16+ the user module defaults to primary group "staff." Earlier don't supply a default, which releases probably results in a primary group nameed "None" (due to stringifying the Python singleton of the same name), or whatever the macOS Directory Services has for no data/NULL.

The invalid GID 4294967295 (MAX_UINT32 == 2**32-1) in the sudo error probably enters the mix via something similar to sudo GHSA-33h3-qhjg-4qmf.

Fixes #692

See

Bruce Wayne : [confused] Am I meant to understand any of that?
Lucius Fox : Not at all, I just wanted you to know how hard it was.
-- Batman Begins

@moreati moreati force-pushed the issue1083-become_pass branch 30 times, most recently from e11c8d5 to 1f15c0d Compare October 26, 2024 17:23
@moreati moreati force-pushed the issue1083-become_pass branch 24 times, most recently from 6b09144 to 15f6676 Compare October 27, 2024 23:03
@moreati moreati changed the title ansible_mitogen: Template become_pass tests: Re-enable become/sudo tests, fix them on macOS runners Oct 27, 2024
@moreati moreati marked this pull request as ready for review October 27, 2024 23:24
The tasks in tests/imageprep/_user_accounts.yml that create users did not
specify a primary group for those users - this left the decision to Ansible's
user module, and/or the underlying OS. In Ansible 9+ (ansible-core 2.16+ the
user module defaults to primary group "staff." Earlier don't supply a default,
which releases probably results in a primary group nameed "None" (due to
stringifying the Python singleton of the same name), or whatever the macOS
Directory Services has for no data/NULL.

The invalid GID 4294967295 (MAX_UINT32 == 2**32-1) in the sudo error probably
enters the mix via something similar to sudo CVE-2019-14287.

Fixes mitogen-hq#692

See
- ansible/ansible#79999
- ansible/ansible@c69c83c
- https://www.sudo.ws/security/advisories/minus_1_uid/

> Bruce Wayne : [confused]  Am I meant to understand any of that?
> Lucius Fox : Not at all, I just wanted you to know how hard it was.
> -- Batman Begins
@moreati moreati force-pushed the issue1083-become_pass branch from 15f6676 to 8a34b92 Compare October 27, 2024 23:27
@moreati moreati merged commit 21e002a into mitogen-hq:master Oct 28, 2024
24 checks passed
@moreati moreati deleted the issue1083-become_pass branch October 28, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test fail with become_user in make_tmp_path.yml but works locally
1 participant