Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2002 23:17:12 -0400
From:      Bill Moran <wmoran@potentialtech.com>
To:        Peter Brezny <pbrezny@purplecat.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: default permissions on a directory
Message-ID:  <3CC623B8.2050209@potentialtech.com>
References:  <HDEBKOFAJCKIJIDMEINCEEEPELAA.pbrezny@purplecat.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Brezny wrote:
> Hi everyone,
> 
> Is there a way to configure a directory in such a way that if any files are
> placed into it, those files will automatically be given a predefined set of
> permissions?

umask

> For example, I've got a samba share that three different users are allowed
> to place files into, however, currently they are only able to be modified by
> the user that placed them there.

Samba has ways of doing this.  Look at the Samba config information.
"user create mask" I believe it's called.

> I'd like any files that go into that diredtory to be chmod 775 by default
> (since the group that owns that directory contains all the users that have
> access).

You may want to exclude x permissions from that, it'll probably never be a
problem, but why risk it.
Using the setgid bit works well, it makes any file created in the directory
belong to the same group as that directory.  Thus, if you give it 660 permissions,
the owner, as well as all members of the group in that directory have access -
works real nice.
chmod g+s /directory/name

-- 
Bill Moran
Potential Technology
http://www.potentialtech.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CC623B8.2050209>