Skip to content

Tracking Issue for unix CommandExt::groups #90747

Open

Description

@cuviper

Feature gate: #![feature(setgroups)]

This is a tracking issue for std::os::unix::process::CommandExt::groups.

Sets the supplementary group IDs for the calling process. Translates to a setgroups call in the child process.

Public API

// std::os::unix::process

pub trait CommandExt: Sealed {
    fn groups(&mut self, groups: &[u32]) -> &mut Command;
}

Steps / History

Unresolved Questions

  • None yet.

Activity

  1. added
    T-libs-api
    C-tracking-issue
    on Nov 10, 2021
  2. added 2 commits that reference this issue on Nov 10, 2021
  3. sugar700 commented on Jan 2, 2022

    @sugar700
    Contributor
        fn groups(
            &mut self,
            #[cfg(not(target_os = "vxworks"))] groups: &[u32],
            #[cfg(target_os = "vxworks")] groups: &[u16],
        ) -> &mut process::Command;

    I think the fact that groups uses a different type for VxWorks seems like a possible issue with the API. I understand that for backwards compatibility reasons gid uses a different type for VxWorks (albeit it may be worth fixing it anyway, see https://rust-lang.github.io/rfcs/1415-trim-std-os.html), but I see no reason to continue with this mistake for a nightly method.

  4. liff commented on Sep 27, 2023

    @liff

    Is there a chance this will end up being stabilized, or is the type of the group ID a blocker here?

  5. Jisu-Woniu commented on Mar 23, 2024

    @Jisu-Woniu

    Any update on this? It's been half a year with no updates.

  6. added
    T-libs
    and removed
    T-libs-api
    on Aug 12, 2026
  7. joshtriplett commented on Nov 23, 2026

    @joshtriplett
    Member

    I think this looks completely ready to ship, other than using the wrong type on VxWorks. If someone would like to fix the type on VxWorks, I'd be happy to start an FCP for stabilization.

  8. added
    I-libs-nominated
    on Nov 23, 2026
  9. joshtriplett commented on Nov 23, 2026

    @joshtriplett
    Member

    Nominated to get team confirmation on readiness.

  10. changed the title [-]Tracking Issue for `CommandExt::groups`[/-] [+]Tracking Issue for `unix` `CommandExt::groups`[/+] on Nov 24, 2026
  11. joshtriplett commented on Nov 24, 2026

    @joshtriplett
    Member

    We talked about this in today's @rust-lang/libs meeting.

    gid using a (private) type alias is unfortunate, and doubly so because rustdoc doesn't show that.

    However, we don't want to be inconsistent here, and it's not obvious if u32 is the thing we want to be moving towards. There are two possible APIs we could move towards (via edition migrations): u32 everywhere, or dedicated Gid/Uid/etc opaque types that would avoid accidentally mixing up arguments. Personally, I'd favor the latter; it's much less error-prone.

    Given that, let's go ahead and ship this using the internal GroupId alias.

  12. removed
    I-libs-nominated
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueT-libs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions