Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Apr 2004 10:07:57 +0100
From:      Peter Risdon <peter@circlesquared.com>
To:        Anthony carmody <anthony@carmoda.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: question about SAMBA shared directory and file permissions
Message-ID:  <4080F3ED.7020408@circlesquared.com>
In-Reply-To: <4080E845.5010701@carmoda.com>
References:  <4080E09D.5030601@carmoda.com> <4080E48A.7040201@circlesquared.com> <4080E845.5010701@carmoda.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Anthony carmody wrote:

>
>
> Peter Risdon wrote:
>
>> freebsd.org@carmoda.com wrote:
>>
>>> Hi,
>>>
>>> i have been having problems with a SAMBA shared directory and user 
>>> permissions. My smb.conf file is simple and allows for members of 
>>> 'wwwdev' access the directory, and they can when i test it, but we 
>>> get all kinds of problems with the permissions on various files and 
>>> directories:
>>
>>
>>
>>
>> It would help if you said exactly what those problems are.
>
>
> sure. i realised i didn't explain just after i sent the mail. doh!
>
> ok: i want really open access 'a-la-windows' style to all files under 
> a certain directory tree to users in a particular group. at the 
> moment, i am having to chown all files over to whom ever is editing 
> them at any given time.


I was thinking more of what happens to file permissions when a file is 
accessed by a samba user. Say they start at something like:

#ls -l

-rwxrw-r-x   1 pwr  wwwdev         637 Apr 17 09:01 testfile

So all members of the wwwdev group have write permission. After access 
by user pwr do they change? Maybe to:

-rwxrw-r-x   1 pwr  pwr         637 Apr 17 09:01 testfile



>
>>>
>>> //////////////////////////////////////////////////////
>>> [wwwdev]
>>>     comment = Virtual Web Servers HTTP dirs
>>>     path = /usr/wwwdev
>>>     create mode = 0765
>>>     valid users = @wwwdev
>>> //////////////////////////////////////////////////////
>>
>>
>>
>>
>> You might also need to set the directory mode on the share.
>
>
> cool, what would you suggest?


See below.

>
>>>
>>>
>>> i assume this is a ownership issue on the unix file system side, 
>>> although i have opened up the permissions to 'pants down in public' 
>>> level ....
>>>
>>> drwxrwxrwx
>>> -rwxrwxrwx
>>
>>
>>
>>
>> So, what is the problem? Do these permissions and/or the file 
>> ownerships get altered when accessed by a Windows client?
>
>
> i would have assumed that because the two users were in the same group 
> they could access the same files in turn without chown-ing.


There's a useful guide to configuring samba at:

http://hr.oregon.edu/davidrl/samba/server.html

And it deals with a similar configuration to the one you're seeking.

But working on a guess that your problem stems from the group flag of a 
file being changed to that of the user who accesses it, you might try 
adding:

create mode 0774  # Windows clients that seems to require the extra bit

directory mode = 0775 #so that new directories are created with the 
right permissions

force group = +wwwdev  # so that all file activity is carried out as 
this user


HTH.

PWR



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4080F3ED.7020408>