[Samba] wbinfo -U arguments vs --help

Michael Tokarev mjt at tls.msk.ru
Mon Oct 31 13:10:05 UTC 2022


31.10.2022 15:58, Rowland Penny via samba wrote:
> 
> 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

Oh! :)  Well, it is even more important in this case to give clean
error message instead of dumping whole --help test on another unsuspecting
user like me ;))

>> Invalid option
>> Usage: [OPTION...]

Because I can't even think - after being in this industry for 30+ years -
that "invalid option" means invalid *value* for an option.  DOH!.. :))

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

Yeah. Dunno. It should be easy to fix.

Thanks,

/mjt



More information about the samba mailing list