Skip to content

groupadd: reuse LoginDefs::apply_overrides for -K instead of hand-patching #223

Description

@pierre-warnier

groupadd handles -K KEY=VALUE in allocate_gid by hand-patching a couple of range variables:

  • it only understands GID_MIN, GID_MAX, SYS_GID_MIN, SYS_GID_MAX — every other login.defs key is silently ignored;
  • invalid values are swallowed (if let Ok(v) = val.parse()), whereas useradd reports a bad argument.

So the same flag behaves differently depending on the tool.

#211 introduces LoginDefs::set / LoginDefs::apply_overrides in shadow-core, which is the general form of this. Once that lands, groupadd should drop its bespoke patching and use the shared helper, giving both tools the same key coverage and the same error behaviour.

Blocked on #211.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions