Sticky Bit? (ie: chmod 2770 vs chmod 770)
From what I understand - performing a CHMOD 2770 on a directory makes all files created in that directory have the same group ownership.
WHAT IF.. I have two directories that were CHMOD 2770's within each other? Say I perform a chmod -r 2770 on MainShare/ drwxrws--- 3 nick users 1024 Jan 19 11:19 MainShare/ However..I also performed a chmod -r 2770 on the folder /MainShare/Finance drwxrws--- nick finance 1024 11:19 Finance/ If a user creates a file inside of Finance, will it have the proper group ownership of "finance"? or will it inherit the /MainShare "user" group? I'm using Samba and would just like to enforce that the file created, will always match the group of the folder its in... |
Quote:
Quote:
|
A concept clarification - there is no inheriting in *nix permissions. For the sticky bit, the parent directory is examined, and that's all.
|
Quote:
Hello! Ok for that but is there a way to make a user create files / folder with permissions 1750 for example? In other words if I create a folder with 1770 how can I set things in order that users can create staff in it with sticky bit already on? acl ... umask ... sticky? Help! :) |
Setting the Sticky bit (t perm option) on a dir will enforce the fact that only the owner of a file in that dir can delete it.
You can't have the t perm option on a file. |
thank you for your reply! :)
You're right: I was wrong because I've always seen I'm able to chmod +t a file but I never tested that it has no effect :( ... never tried it before. Thanks for clarifying this for me :) Anyhow I'm still trying to understand how to inherit the sticky bit on new folders (he he he:)) under a folder with sticky bit on. I explain it better: I chmod 1770 a test_folder If I set the general umask, or acl mask specifically on it, to be 770 users will create new folders with 770 permissions of course but no sticky bit! umask and mask seem to work only with the last three digits .. or am I wrong? ... so no way to inherit the sticky bit even if I set a mask with 4 digits as for example 6007 So how to permit users to create new folder already with the sticky bit activated under test_folder??? :confused: Maybe only a cron job can chmod 1770 -R test_folder. But has this got a sense? |
Quote:
|
I'm pretty sure you can't 'inherit' the sticky bit, or any perms really. Linux doesn't inherit, it's all down to umask & acls. I'd be interested to know if you can enforce the sticky bit via those, but I've never heard of it. If I was a betting man I'd bet it's strictly a chmod thing... ;)
|
All times are GMT -5. The time now is 02:13 AM. |