[Samba] Incorrect permissions on mount despite correct options

Michael Carmack karmak at karmak.org
Sun Apr 18 07:20:58 GMT 2004

Tim Starr wrote:
> The problem was 
> that it was/is being mounted under the following permissions:
> tstarr at host:~/mount$ ls -l
> total 0
> drwxr-xr-x    1 501      dialout         0 Apr  7 20:39 Audio
> drwxrwxr-x    1 501      dialout         0 Apr  9 01:29 Desktop
> Now I have no user 501 on my system and no dialout group either. Odd. 

With Linux kernel 2.6.x and 2.4.25+, CIFS Unix extensions are in effect, 
allowing you to view and manipulate Unix-y things like symlinks and 
suid/sgid files using Samba.

This also has the effect that the Unix UIDs and GIDs from the server get 
passed to the client.

If you look on the server, you'll see that "501" is the numeric ID for 
the user that actually owns the file. And though you may not be aware of 
it, you *should* have a group called "dialout" on the Linux machine. 
(Look at /etc/group to confirm.) You'll notice that the numeric ID for 
the "dialout" group on your Linux machine maps to the numeric ID for the 
file's group on the server.

[In case you were wondering what the point of this is, these changes 
make Samba play nicer with Unix machines. It makes it possible to 
replace something like NFS with Samba.]

In the 2.4 series (as of 2.4.25), the Unix extensions are an optional 
configuration of the Linux kernel (i.e. you enable or disable this when 
building the kernel). I haven't looked at 2.6 yet, but I suspect it's 
also optional there. I don't know whether you can turn this behavior off 
or on after the kernel is built (using a mount option or a /proc setting 
or something), as I just started using it myself.

FWIW, I've encountered a couple pitfalls myself. I think maybe there are 
still some issues to work out, so if Samba was previously doing 
everything you needed it to and you don't need the Unixy features, you 
might want to use a kernel that has these entensions disabled.

(Just a slight caution: I haven't spent a lot of time using Samba, so I 
may be a little off with some of the things I just said. If so, 
hopefully the experts will set the record straight.)


More information about the samba mailing list