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.
groupaddhandles-K KEY=VALUEinallocate_gidby hand-patching a couple of range variables:GID_MIN,GID_MAX,SYS_GID_MIN,SYS_GID_MAX— every other login.defs key is silently ignored;if let Ok(v) = val.parse()), whereasuseraddreports a bad argument.So the same flag behaves differently depending on the tool.
#211 introduces
LoginDefs::set/LoginDefs::apply_overridesinshadow-core, which is the general form of this. Once that lands,groupaddshould drop its bespoke patching and use the shared helper, giving both tools the same key coverage and the same error behaviour.Blocked on #211.