[Samba] wbinfo -U arguments vs --help

Rowland Penny rpenny at samba.org
Mon Oct 31 12:58:59 UTC 2022



On 31/10/2022 12:35, Michael Tokarev via samba wrote:
> For fun, just found an interesting tidbbit with wbinfo cmdline parsing..
> 
> # wbinfo --help | grep uid-to
>    -U, --uid-to-sid=UID                               Converts uid to sid
> 
> but:
> 
> $ wbinfo --uid-to-sid=mjt

The invalid option is 'mjt', it isn't a number, you are possibly 
mistaking it for the rfc2307 attribute 'uid' which is a name. The 'uid' 
in this instance is the users Unix ID e.g.

rowland at devstation:~$ wbinfo -U 11104
S-1-5-21-627072207-2265849604-124128874-1104


> Invalid option
> Usage: [OPTION...]
>    -u, --domain-users                                 Lists all domain 
> users
> ...
> 
> Here, there are 2 issues: first, it does not recognize -U/--uid-to-sid
> option at all (which is listed in its help output and is documented
> in the manpage).
> 
> It is interesting how this ever happened. It seems to be consistent
> in 4.13, 4.16 and 4.17 releases.

It as been like that since 4.0.0 at least.

> 
> And second, and this very annoying issue is quite common - it prints
> out whole --help output in case of option error. It should only print
> help/usage when --help is requested, - in case of actual error, this
> makes it difficult to find.  And it definitely should clarify which
> option is invalid, - it is easy to see if there's only one option,
> but if the command line is long, finding the wrong one becomes a
> real challenge...


If you wish to change it, I would expect that patches would be readily 
acceptable ;-)

Rowland

> 
> /mjt
> 



More information about the samba mailing list