Bug 1126411 - RFE: useradd should strip leading/trailing spaces from groups given with -G/--groups
Summary: RFE: useradd should strip leading/trailing spaces from groups given with -G/-...
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-04 11:44 UTC by Matthew Miller
Modified: 2018-12-20 15:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2018-12-20 15:30:21 UTC
Type: Bug

Attachments (Terms of Use)

Description Matthew Miller 2014-08-04 11:44:53 UTC
Description of problem:

If one provides a list of groups containing a space, you get an error. This is easy to do when a shell script calls out to useradd with user-provided data (see for example bug #1126365).

Version-Release number of selected component (if applicable):


How reproducible:

Inherent. (And documented in the man page.)

Steps to Reproduce:
1. sudo useradd foo --groups wheel,adm
2. sudo useradd bar --groups "wheel, adm"

Actual results:

First one works, but second says "useradd: group ' adm' does not exist".

Expected results:

Both should work -- strip leading or trailing spaces

Additional info:

groupadd does not permit the creation of groups containing spaces

Comment 1 Tomas Mraz 2018-12-20 15:30:21 UTC
We are not going to pursue this RFE at this point. If anyone wishes to work on this I'd suggest creating pull request on shadow upstream.


Note You need to log in before you can comment on or make changes to this bug.