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

sudo: -u longusername fails when effective group id cannot be resolved into a group name #771

Open
japaric opened this issue Sep 19, 2023 · 1 comment
Labels
non-compliant used to track failing compliance tests

Comments

@japaric
Copy link
Collaborator

japaric commented Sep 19, 2023

relevant test

https://github.com/memorysafety/sudo-rs/blob/0b9207b67dbaf32cf05791c1e2d18cd910d3ffb7/test-framework/sudo-compliance-tests/src/sudo/misc.rs#L205-L225

useradd does not work with usernames with usernames longer than 32 characters. this issue is only observed with usernames longer than 32 characters. when editing /etc/passwd (instead of useradd) is used to create the user

@japaric japaric added the non-compliant used to track failing compliance tests label Sep 19, 2023
@japaric
Copy link
Collaborator Author

japaric commented Sep 19, 2023

the above test does not update /etc/groups, i.e. it does not assign a primary group to the new user. this makes the groups command fail:

root@a22ac8003931:/tmp# groups aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa : groups: cannot find name for group ID 1001
1001
root@a22ac8003931:/tmp# echo $?
1

I think sudo-rs is failing because it's trying to resolve the group ID into a group name whereas ogsudo is not while still being able to execute the complete pipeline.

@japaric japaric changed the title sudo: -u longusername fails with "group '' not found" sudo: -u longusername fails when effective group id cannot be resolved into a group name Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-compliant used to track failing compliance tests
Projects
None yet
Development

No branches or pull requests

1 participant