LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ACL problems (https://www.linuxquestions.org/questions/linux-newbie-8/acl-problems-649591/)

kenneho 06-16-2008 04:12 AM

ACL problems
 
Hi.


I've set default ACLs on one of my folders, say, "test". The default ACL says that user "testuser" have rwx permissions on test (and therefore its subfolders).

Although "testuser" has rwx permissions on folder "test", it is now allowd to delete files and folders found here. BUT, "testuser" is allowd to delete files and folders found under subdirectories of "test", for example "test/folder1".

So in other words, "testuser" is allowed to delete files under subdirecories of "test", but not directly under test itself. To me this seems very odd.

Can anyone explain why this is happening? How can I make sure that "testuser" has full permissions starting from folder "test"?


Regards,
kenneho

kenneho 06-16-2008 04:19 AM

To make things more clear, this is my sample file structure:

test/
test/file1.txt
test/folder1/
test/folder1/file2.txt
test/folder1/folder2/
test/folder1/folder2/file2.txt

Before creating the files and folders under "test" I set the default ACL for "test" to "user:testuser:rwx".
To my best knowledge, this should enable "testuser" to delete files and folders under "test". But "testuser" is only allowed to delete files and folders starting at level 2 i.e. from "folder1".

shahz 06-16-2008 04:20 AM

is that ACL problem or directory permission can't make sense of your question. and where did you define the ACL for testuser.

thanks

kenneho 06-16-2008 04:31 AM

Quote:

Originally Posted by shahz (Post 3185989)
is that ACL problem or directory permission can't make sense of your question. and where did you define the ACL for testuser.

thanks

Sorry, didn't quite understand your question. :/ Can you please rephrase that?

Anyway, this is how I set the ACL for "testuser":

Code:

setfacl -m d:u:testuser:rwx /var/tmp/test/
The /var/tmp/test folder is owned by root, and has "other" permission rx.

jschiwal 06-16-2008 06:05 AM

You will need to show the permissions and acl's for each subdirectory and file.
To delete a file, a user needs write permissions on the containing directory. Creating or deleting a file writes to the directory. If the sticky bit is set, then only the owner can delete a file. This allows multiple users to create files in /tmp but only the owner can create the file.

Don't assume that files and directories inherent the acl's of the parent directory.

kenneho 06-16-2008 06:32 AM

Solved
 
I think I got things working now. Turn out that in addition to setting the default ACLs for the folder "test", I had to set similar ACL attributes to the folder itself. Thought this was implied when setting the default ACL on the folder, but I guess it wasn't.


All times are GMT -5. The time now is 06:20 AM.