trifectatechfoundation / trifectatechfoundation/sudo-rs
Groups added by `pam_group` are not added by sudo
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 179
- Avg merge
- 16h 45m
- Merged PRs (30d)
- 4
Description
See #1660, this is the second item identified in that issue.
To reproduce:
- Add
pam_group.soto the PAM auth stack - Add a line like
*;*;testuser;Al0000-2400;testgroupto/etc/security/group.conf - Run
sudo -utestuser idand notice thattestgrouphasn't been added.
Related in ogsudo:
* src/sudo.c:
Do group setup in policy_init_session() before calling out to the
plugin. This makes it possible for the pam_group module to change
the group in pam_setcred(). It's a bit bogus since pam_setcred() is
documented as not changing the group or user ID, but pam_group is
shipped with stock Linux-PAM so we need to support it.
[f88da1c1a]
https://github.com/sudo-project/sudo/commit/f88da1c1a
I'm not convinced that we need this, so let's first discuss if that's the case.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related src/sudo.c change and policy_init_session() reference from commit f88da1c1a, then reproduce the pam_group setup with /etc/security/group.conf and sudo -utestuser id. The issue is complete only after determining whether sudo-rs should support these PAM-added groups and agreeing on the required behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- authorization, operating-systems, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100