Need help on "net ads join" fails when we have "%" in the username - 2nd Try........

Rowland Penny repenny241155 at gmail.com
Mon Aug 31 15:25:30 UTC 2015


On 31/08/15 16:07, Richard Sharpe wrote:
> On Mon, Aug 31, 2015 at 4:07 AM, Rowland Penny <repenny241155 at gmail.com> wrote:
>> I do not think it will, I think the username/password will get expanded to
>> 'test%user%password' and it will be read as the user test with a password of
>> user%password or just user.
>>
>> I would never use '%' in a username, samba & windows both use it as a
>> delimiter, but if you must use it, then this *may* work:
>>
>> net ads join -U test\%user%password
> Unfortunately, that won't work. The shell is not doing the delimiter
> separation. So, the net command will see two '%' chars and will
> separate on the first.
>
> What is needed is a change to the net command code.
>
> Unfortunately, it is hard to tell customers that they are stupid.
>
> If the OP cares to he can look at the code in source3/utils/net.c
> around line 992 in the current master and he can see the parsing of
> the -U parameter. It is pretty simple and could be modified to handle,
> say \% as not a delimiter.
>
> However, in bash/sh you would have to use \\% or enclose the string in
> single quotes.
>
> Another approach might be to allow the specification of a different
> delimiter, like, say + or ^ etc.
>
> Ahhh, the power of open source software.
>

When I posted, I really didn't think it would work, but I have never 
been stupid enough to use something in a username that I know is a 
delimiter used by Samba and windows. If the OP is willing to take a bit 
of advice, I would advise him to stop using stupid things in usernames. :-)

Rowland



More information about the samba-technical mailing list