LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-17-2009, 06:32 AM   #1
Prabagaran
LQ Newbie
 
Registered: Mar 2009
Posts: 17

Rep: Reputation: Disabled
Post Directory Mask is not properly working on samba shared folders


Hi All,

I have Fedora core 8 installed in my machine, in which I have shared certain folders (public) for windows access.
--------
Sample Configuration of my smb.conf

[common]
comment = Common to all
path = /mnt/common
writeable = yes
directory mask = 0777
; browseable = yes
write list = +staff
valid users = <list of " +staff " group members separated by comma, which got added automatically when "Only allow access to specific users" option is selected and given permissions to those who are only under "+staff" group through Samba Server Configuration Wizard using "system-config-samba" command>
--------

And the folder (in my case the folder name is "common") permission is set to 0777, where uid =<samba-user>, gid=+staff.

Example:

drwxrwxrwx 3 <samba-user> <staff> 12288 2009-03-17 15:40 common


The problem is, whenever a file which is under "common" (the public folder) is edited by any of the user who is under "+staff" group, the particular file's ownership and permission is got changed to that particualr user. If an another member user who is under the same "+staff" group tries to access the same file, he/she can view it as Read-only but cannot write to it, throws "no permission, access denied" error.

Example of a file whose permission and ownership got changed automatically after editing it (sample.txt) by a samba-user:

-rw-r--r-- 1 <samba-user> <samba-user> 6421767 2009-02-28 05:46 sample.txt

The same problem whenever a member of "+staff" group creates a new file or folder.
Example:

-rwxr--r-- 1 <samba-user> <samba-user> 0 2009-03-17 16:35 New Text Document.txt


My requirement is, there should be a public folder, where all can access, read and write but the permission and ownership shouldn't get changed after edited by any of the member who are under "+staff" group.

Suggestions and Solutions would be a great help !

Regards,
Prabagaran L.
 
Old 03-17-2009, 07:34 AM   #2
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
Try:

Quote:
[common]
comment = Common to all
path = /mnt/common
writeable = yes
create mask = 770
directory mask = 770
valid users = @staff_group
read only = No
force group = staff_group
 
Old 03-17-2009, 07:38 AM   #3
cyprinidae
Member
 
Registered: Oct 2008
Distribution: Fedora, CentOS, Crunchbang
Posts: 46

Rep: Reputation: 16
You need to set SGID for the directory
Code:
# chmod g+s /mnt/common
so if any of the users create a file in the directory, it will be marked with staff as the group, even though their primary group is different
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing directory default creation mask for specific folder - NOT samba. maginotjr Linux - General 3 01-21-2009 09:36 AM
Cannot Shared Folders with different rights using samba shebatuni Linux - Newbie 1 07-17-2008 07:01 PM
Canīt see shared folders using Samba al2 Linux - Server 2 08-25-2007 12:52 PM
Samba - Create mask not working... Dmjmusser Linux - Networking 5 02-10-2006 04:57 PM
Samba not accessing my Windows Shared folders Felpipe Linux - Networking 3 08-04-2005 08:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration