Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 702102 - user.eclass : syntax error in printed usermod command
Summary: user.eclass : syntax error in printed usermod command
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-05 20:18 UTC by Ralph Seichter
Modified: 2022-12-07 00:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Seichter 2019-12-05 20:18:14 UTC
I updated to Dovecot 2.3.9 and was presented with the following message:

  >>> Installing (5 of 5) net-mail/dovecot-2.3.9::gentoo
  Please read https://wiki2.dovecot.org/Upgrading/ for upgrade notes.
  Messages for package acct-user/dovenull-0:
  There was an error when attempting to update the groups for dovenull
  Please update it manually on your system (as root):
  usermod -g dovenull -G  "dovenull"

The above usermod statement is syntactically incorrect. I assume that

  usermod -g dovenull -G "" dovenull

it what was actually intended here.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-12-05 21:29:14 UTC
That message is written by acct-user.eclass.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-12-05 21:31:00 UTC
(In reply to Jeroen Roovers from comment #1)
> That message is written by acct-user.eclass.

No, user.eclass...
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-12-09 19:33:28 UTC
I suspect we could make it:

 "usermod" "-g" "dovenull" "-G" "" "dovenull"

without too much effort.  Getting beyond that would probably be an overkill.

That said, is there a deeper bug that the update didn't work for you, or did you figure that out?
Comment 4 Ralph Seichter 2019-12-09 19:43:15 UTC
(In reply to Michał Górny from comment #3)

> "usermod" "-g" "dovenull" "-G" "" "dovenull"
I did notice the extra space in the error message, so I assumed it was due to the lack of quoting the group name (which in this case is empty).

> is there a deeper bug that the update didn't work
> for you, or did you figure that out?
No deeper bug, thanks. The intended statement only strips user dovenull of any secondary groups. All is well. ;-)
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-12-09 19:47:13 UTC
(In reply to Ralph Seichter from comment #4)
> (In reply to Michał Górny from comment #3)
> 
> > "usermod" "-g" "dovenull" "-G" "" "dovenull"
> I did notice the extra space in the error message, so I assumed it was due
> to the lack of quoting the group name (which in this case is empty).

Yes.  So, do you think I should change it to safely overquote?

> 
> > is there a deeper bug that the update didn't work
> > for you, or did you figure that out?
> No deeper bug, thanks. The intended statement only strips user dovenull of
> any secondary groups. All is well. ;-)

I meant: why didn't the eclass correctly update it itself, and asked you to do it instead?
Comment 6 Ralph Seichter 2019-12-09 21:52:11 UTC
I think that correctness beats "looking pretty" every time when generated commands are the subject. Superfluous quotes are therefore fine by me.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-12-13 16:40:32 UTC
Actually, I've found a better solution: printf builtin has '%q' format that takes care of quoting as necessary.  So something like:

  set -- command arg "${foo}" "${bar}"
  "${@}" && return 0
  # ...
  ewarn "  $(printf '%q ' "${@}")"

should get the call reprinted with quoting/escapes added where necessary.
Comment 8 Ralph Seichter 2020-11-20 19:28:37 UTC
Bump.
Comment 9 Mike Gilbert gentoo-dev 2022-12-07 00:01:24 UTC
user.eclass has been removed from the gentoo repo.