0
man chmod-                                                                                                                                                                                   
                                                                                                                                                                                         
[...]                                                                                                                                                                                        
RESTRICTED DELETION FLAG OR STICKY BIT                                                                                                                                                       
[...]                                                                                                                                                                                        
For directories, it prevents unprivileged users from removing or  re_ naming  a file in the directory unless they own the file or the directory;                                             
[...] 

alice@debian:/tmp$ ls -l aclfile                                                                                                                                                             
-rw-rw-r--+ 1 alice alice 25 Jul  6 11:53 aclfile                                                                                                                                            
                                                                                                                                                                                             
getfacl -c aclfile                                                                                                                                                                          
user::rw-                                                                                                                                                                                    
user:bob:rw-   
                                                                                                                                                                          
group::r--                                                                                                                                                                                   
mask::rw-                                                                                                                                                                                    
other::r--

so theorically bob should be able to write into that file (aclfile)

bob@debian:/tmp$ echo 'write from bob' >> aclfile                                                                                                                                      
-bash: aclfile: Permission denied    
                                                                                                                                                                                                                                                     

Nore vi does allow 'write access'.

I remove sticky bit from parent dir:

root@debian:~# chmod -v o-t /tmp                                                                                                                                            
mode of '/tmp' changed from 1777 (rwxrwxrwt) to 0777 (rwxrwxrwx)  

root@debian:~# ls -ld /tmp                                                                                                                                                                   
drwxrwxrwx 15 root root 4096 Jul  6 12:01 /tmp                                                                                                                                     
                                                                                                                                                                                         
bob@debian:/tmp$ echo 'write from bob' >> aclfile-                                                                                                                                           
bob@debian:/tmp$ cat aclfile                                                                                                                                                             
write from bob 
                                                                                                                                                                                                                                                                                                                                               

so my question is: Why the sticky bit on the parent dir does-
not allow a user (with write access via acl) to write into that file?

thanx folks !

achille
  • 103
  • 9

0 Answers0