Yes. The owner of a directory can set the suid and sgid of the directory. Files created by other users will then inherit the owner and group of the parent directory. The permissions on a new file or directory will be masked according to your umask setting.
---
update:
I tried it out with a directory I created on in my home directory. I created it as root and gave it 7777 permissions. A file I created there as a regular user had the group ownership of root but not the ownership. A directory I created there had the group of root but I was the owner.
There may be a capability setting that doesn't allow suid on directories; and maybe there's a good reason why.
---
If you have a directory structure that you want to create, you could use brace expansion to do it, and then use chown and chmod recursively.
mkdir -p store/{1..10}
This will create directory "store" with ten subdirectories "1".."10".
Last edited by jschiwal; 11-28-2007 at 12:48 AM.
|