APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

When Samba Pigs Fly

Yesterday a customer called because he needed to be able to write into a certain share on his Samba server. I ssh'd right in, made the change to the config file, restarted Samba and shot him off an "All set!" email.

Such confidence had I that immediately after hitting send, I left my house to do some errands and when I realized I had forgotten my phone, I didn't even bother to go back for it: everything is under control, all pigs are fed and ready to fly.

Yeah. When I got home, I found both phone and email messages from my customer. Such a nice guy he is - he was APOLOGIZING to me because it didn't work. "Maybe I'm doing something wrong?", he asked.

I ssh'ed in again and saw my "mistake". I had written "writeable" rather than "writable" in the config file. I quickly fixed that, restarted Samba, snapped off another email explaining my error and took a break for lunch.

Unfortunately the pigs seemed to still be having a little trouble with the flying stuff. I had barely bitten into my sandwich before he called again. Permission denied. Can't do it. Was he doing something wrong?, he begged to know? Of course not, I assured him. The damn pigs were just being stubborn.

I double checked. Yes, he had write permission in the directory. What the heck? Here's part of the config file for your amusement:

	comment = Home Directories
	read only = No
	browseable = No

	comment = All Printers
	path = /var/spool/samba
	printable = Yes
	browseable = No

	comment = syn75
	path = /usr/syn75
	browseable = yes
            read only= Yes

	comment = cponline
	path = /usr/syn75/00/CPONLINE
	browseable = yes
	writable = Yes 

Those pigs have wings, dammit! So exactly what happens, I asked?

"I choose Save As. I navigate down to CPONLINE..."

Ooops. Magic word. He said "Down", didn't he? The pigs all perked up and started tentatively fluttering their wings. I asked the $64,000 question: "Are you going through the Syn75 share or the CPONLINE share?"

NO, he was not using CPONLINE. He was navigating down through the Syn75 share. THAT share has no write permission - it doesn't matter that CPONLINE is under it, that only is writable if you come to it through the CPONLINE share! I had him map a network drive to CPONLINE and the pigs lifted off into the sky and everybody was happy.

Because he's such a nice guy ("Maybe I'm doing something wrong?) and because I should have paid more attention when he asked that, I'm not even sending him a bill for any of it.

Pigs: to your stations! Fly, you pink porkers, fly!

Got something to add? Send me email.


Increase ad revenue 50-250% with Ezoic

More Articles by

Find me on Google+

© Anthony Lawrence

Thu Nov 5 03:54:22 2009: 7431   Ed

LOL! That's a nice client, though.
I was, sometime in the recent past, bitten by problems with a MacOSX client connecting to Samba shares and messing up permissions. The multitude of Windows users could get along fine with each other, but permissions were being changed for files/folders created by the Mac, in total disregard of settings in smb.conf.

After a lot of fruitless Googling, a colleague found the answer:

Stuck that in, worked fine. Didn't suspect Samba on Linux would give a "frat bro" preferential treatment :-P but now I know...


Thu Nov 5 08:42:49 2009: 7432   NickBarron

It is nice when the penny drops like that....

'Down you say huh?' :)

Previous poster the link you have put up doesn't seem to work incorrect permissions. Though maybe just me as I am using mobile broadband.

Thu Nov 5 11:06:29 2009: 7433   Michiel

It's not your mobile internet - the page gives an error for me too:

You don't have permission to access /samba@lists.samba.org/msg98288.html on this server.

Thu Nov 5 13:12:12 2009: 7435   TonyLawrence

That problem starts at DocRoot.

The original message surely came from lists.samba.org (which has a bad cert), but I don't find any easy way to find a specific message

Thu Nov 5 13:24:10 2009: 7436   TonyLawrence

I was able to get it from Google cache. The issue was

We have an issue using Mac OS 10.5 with our Samba shares connected via cifs://server/Sharename. From what I can tell, when the Mac writes a file the permissions are correct (0660). Then it seems to change the permission to 0644, defeating the whole point of shared files.

The share in smb.conf had

path = /path/ShareName
valid users = @somegroup
write list = @somegroup
read only = No
create mask = 0660
directory mask = 0770
force create mode = 0660
force directory mode = 0770

and the posted solution

Setting "unix extension = no" fixed the permissions problem.

Thu Nov 5 16:06:43 2009: 7439   BigDumbDinosaur

writable and writeable are synonyms in Samba.

BTW, whomever made the CPONLINE share a subshare of syn75 should be forced to slop the hogs for a week for making such a newbie mistake. Oink! Oink!

Thu Nov 5 19:03:03 2009: 7441   Michiel

I didn't even know that you could nest shares.

Thu Nov 5 21:11:30 2009: 7442   Ed

Apologies to those of you complaining that the URL is broken... I just tried it again, and it works for me... strange. I wonder what browsers you're using? I'm using Firefox 3.5.3.
Sorry you had to fetch it from Google cache, Tony. Hope the info was new, though.


Kerio Samepage

Have you tried Searching this site?

Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us