LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   samba: forward permission bits to unix/linux clients (http://www.linuxquestions.org/questions/linux-server-73/samba-forward-permission-bits-to-unix-linux-clients-818554/)

cdex 07-07-2010 01:30 PM

samba: forward permission bits to unix/linux clients
 
Hello everyone,

for my samba configuration problem, I can't find a good solution:

When mounting a samba share with linux, I want to have the permission bits forwarded from the server side (especially the eXecute bits).

The old/usual workaround for this is the mount option e.g. file_mode=0755
But, I don't want to set it for ALL files. Only those files should be executable which are executable on the server ...

my smb.conf contains:
Code:

follow symlinks = yes
# follow symlinks to paths outside the share
wide links = yes
# not at the same time ..
unix extensions = no

samba version 3.4.7 on both sides (Ubuntu Lucid, 10.04)

I need the "wide links" feature. Therefore, "unix extensions" is disabled anyway. Is this my problem or can I reach my goal alongside this settings ?

The documentation is somehow misleading, as it focuses on the Windows interpretation of permissions. But my question does not touch Windows: Linux <=> SAMBA <=> Linux
(Sometimes, I access this share with Windows too, but that shouldn't matter here.)

Has someone an idea ?
Thanks,
cdex.

mostlyharmless 07-08-2010 02:18 PM

Quote:

Only those files should be executable which are executable on the server ...
But executable by which users on which machine? The users and groups on the server aren't necessarily the same as the users on the client. Presumably you only want root users (on either machine) to have root execute privileges on the server...

The solution should be to give your "client machine users" accounts with the same name on the server.

Or am I missing the question entirely?

cdex 07-09-2010 09:32 AM

Thanks for your time :)

Quote:

Originally Posted by mostlyharmless (Post 4027604)
Or am I missing the question entirely?

hmm, kind of, but no problem. Let me tell more background:

With samba I export data from the server which has there some users/groups and permissions set, as you mention. When I mount a samba share on the client, that doesn't matter because I can set all this at mount time completely arbitrary:

Code:

smbmount //192.168.5.1/my_share /mnt/host/ -o credentials=cred_host,uid=tet,gid=tet,file_mode=0644,dir_mode=0755,noserverino
As you see, I reset the user/group and permission to something useful on the client.

What I'm interested in, is the file_mode=0644
if I omit it, the default is used which is 0755 or similar. But the problem is, it's applied to all files independent of the setting on the server.

I would like to know if samba exports the permission bits also somehow ? To get individual file permissions without having to overwrite them with a default (all on the client side).

And, if I have to use unix extensions = yes to get this feature or if there is another way ? (Although I'm not sure if it's supposed to work with this setting)

mostlyharmless 07-09-2010 03:37 PM

Quote:

But the problem is, it's applied to all files independent of the setting on the server.
Unfortunately, as far as I know, (from what I've read), there's no way to change the setting file by file in samba alone.

I suppose you could give them all execute privileges and write a filter of some sort to look at the permissions on the server and then deny execute privileges for files which didn't originally have execute permissions....

...but don't ask me how, it's over my head!


All times are GMT -5. The time now is 03:20 PM.