[Samba] Smbclient command line password parsing

Dan Reagan samba.user at bytewrangler.com
Wed Jun 22 16:41:06 GMT 2005

Hi there,

I've got a question about the way that smbclient parses the password 
from the command line in the -U argument (i.e. -U'username%password'). 
This came up recently when I was trying to figure out why the cupsaddsmb 
command was failing for me.

It appears that smbclient can't take passwords out of the command line 
with leading 'special' characters such as = or @. All other samba 
functions seem to work great (thanks very much!) but I was unable to run 
cupsaddsmb with my offending passwords. Coincidentally, the two 
administrative accounts that I was using to try and run the command had 
one of those as the first character of the password.

I found that I could manually run the smbclient commands that cupsaddsmb 
was trying to run if I removed the -N and pulled the password from -U 
and entered it at the smbclient password prompt. However, it never 
accepted the funky character passwords on the command line. As soon as I 
changed the password in my auth backend to something less funky 
everything worked. I've included some command line examples below.

Is this a known issue? If so, is there a workaround? I tried a couple of 
different ways of quoting the password but didn't meet with success. If 
it's unknown and not worth fixing I think that I'd like to drop a note 
to the CUPS folks so they can at least put something in the README to 
save the next guy the head-scratching that I went through.

Thanks for shedding any light on this for me,

Dan Reagan

***Command Line Examples***

- First change root smbpasswd to 'secret' and then log in at command 
line with no problems:

test00:/# smbclient //localhost/print\$ -N -U'root%secret'
Domain=[TEST] OS=[Unix] Server=[Samba 3.0.14a-Debian]
smb: \>

- Then change root smbpasswd to '=secret' and log in at command line fails:

test00:/# smbclient //localhost/print\$ -N -U'root%=secret'
Anonymous login successful
Domain=[TEST] OS=[Unix] Server=[Samba 3.0.14a-Debian]
tree connect failed: NT_STATUS_ACCESS_DENIED

- However, log in with prompt for password works:

test00:/# smbclient //localhost/print\$ -Uroot
Domain=[TEST] OS=[Unix] Server=[Samba 3.0.14a-Debian]
smb: \>

More information about the samba mailing list