Ramblings of a Deranged Mind
Leopard & Samba & Plaintext Password
So, this one is so weird that I *have* to blog about it.A number of my colleagues have upgrades their MacBooks to Leopard and then discovered that they can no longer mount their home directories via our corporate Samba systems. Now, the first thing I should mention is that our Samba servers use plaintext passwords (the reason for this is too long to explain here) so the first step is to enable plaintext password support in Leopard.
To do this, you create a /etc/nsmb.conf file using the following command via Terminal:-
sudo vi /etc/nsmb.conf
and you enter the following two lines:-
[default] minauth=none
Save the file and reboot your machine. When you get back to the Finder, under the "Go" menu select "Connect to Server", and enter the server address URL, usually in the format
smb://<servername>/<loginID>
You should then get a prompt asking for a name and password.
Here's the magic part.
If you have a password with a percent symbol ('%') the login will fail. What you need to do is to change your password so that it doesn't have the '%' symbol and it should all work.
WHY???
My suspicion is that Leopard is constructing a mount URL using the information provided from the login dialog box. The full format of the URL is:
smb://<userID>:<password>@<servername>/<sharename
Since this is a URL, Leopard is parsing the whole string looking for escape characters which start with (you guessed it!) a percent symbol. The format of the escape sequence is %hh where hh is a two digit hexademical value. For example, a space character is ASCII 32 decimal or 20 hexadecimal, so the escape sequence for a space would be %20.
If your password has a percent symbol, the next two characters are interpreted as a hexadecimal value. If it happens to be a valid hex value, the all three characters (the % and the next two) are replaced with one character, which changes the password and the login will fail.
If the two characters are not valid hex values, then the nameauth daemon will crash with a "Bad Number" error (you can see this in the Console) and the mount dialog will spin forever.
So far, I've only been able to prove this with one machine, but I'd be interested to hear if anyone else has similar experiences.
Why this breaks in Leopard but works perfectly well in Tiger is beyond me!
Posted at 12:05AM Jan 30, 2008 by samktan in IT | Comments[4]
Wednesday Jan 30, 2008
I have such experience too.
I'm working in a cross-platform project.
The project team has two Mac Pro(Tiger) and we often share files between PC and Mac.
Everything worked well until one day 3 new Leopard Mac Pros arrived.
I can no longer access my PC from those 3 machines but my colleagues can.
It cost me 3 days to figure out the reason.
I tried to log in with my domain account with a strong password which contain several symbols, one of them is "%".
My colleagues' passwords aren't strong enough as mine :) , so they worked around the BUG without knowing it.
Posted by Harok on March 05, 2008 at 09:16 PM EST #
The percent sign bug was fixed in 10.5.2.
Posted by Phil Pishioneri on March 21, 2008 at 09:18 AM EST #
What if I don't use a password to connect? I was able to modify my OS 10.4 to connect to my samba shares but I can't seem to get 10.5 to work. Any ideas?
Posted by Jordan on March 29, 2008 at 02:04 AM EST #
I tried with
[default]
minauth=none
streams=yes
soft=yes
and no worked
Posted by richard_site on June 03, 2008 at 11:00 AM EST #