[Leaplist] special dir permission

Tom Parker tom at fnords.net
Sat Jul 4 11:06:14 EDT 2009


On Sat, Jul 4, 2009 at 9:33 AM, Ingo Claro <miclaro at netred.cl> wrote:

> Hello all:
>
> I'm trying to have a directory with permissions so that any file created
> inside it has the same owner and group of the directory.
> I tried with 06770, but when I make a file inside it has my owner and the
> directory owner. So how can I acomplish that?
>

I don't know if that's possible.  I know you can force group membership this
way:

mkdir test
chgrp blah test
chmod g+s test

Now any file created in the test folder will be part of the 'blah' group.

If you try to 'chmod u+s test' it does not make all files in the folder have
the same ownership as the directory.  I'm not certain why it is this way,
but I can see some security issues if it did.  An attacker could use this
folder to create files with the SUID bit set and then run files as that
user.  If that user were root, bad things would happen.

Tom Parker

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.leap-cf.org/pipermail/leaplist/attachments/20090704/a77adec2/attachment.html


More information about the Leaplist mailing list