Trailing/empty entry in --groups list produces a confusing error message #4
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
utils/warproot#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
LookupGroupsWithinsrc/user/user.go(lines 49-63) splits the--groupsvalue on commas without filtering out empty entries:If the list has a trailing (or leading, or doubled) comma, e.g.
--groups=1000,,strings.Splitproduces["1000", ""]. The empty string is then looked up as a group name and fails, producing the misleading errorgroup "" not foundinstead of a message that points at the actual problem (an empty/malformed entry in the list).Steps to reproduce
Expected behavior
Either skip empty entries produced by splitting, or return a clear error such as
invalid --groups value: empty group name in list %q, so the user understands the list itself is malformed rather than thinking a group literally named""doesn't exist.