trifectatechfoundation / trifectatechfoundation/sudo-rs

Groups added by `pam_group` are not added by sudo

Open
#1,665 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-exec C-pam consultation enhancement
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.so to the PAM auth stack
  • Add a line like *;*;testuser;Al0000-2400;testgroup to /etc/security/group.conf
  • Run sudo -utestuser id and notice that testgroup hasn'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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.