Hello,<br><br>I am seeing some strange behavior with extended permissions on ext3. I am writing a file as root and setting a user ACE. I then change to that user and try to access the file based on the ACL that I have set. <br>
<br>In the example below, I am setting a user ACE to have no permissions to access the file (---). However, I find that when I access the file as that user, I am able to read it. I find this strange because according to the man page, as soon as it matches the user ACE entry, it should allow or deny access.<br>
<br>If I set an identical ACL except I add the "wx" permission bits to the user ACE (-wx), I am rejected (which is what I expect). I am just wondering why I can read the file when I have no permissions (---) set on the user ACE (I expected to be rejected). Examples are below:<br>
<br>Example with no permissions for the user ACE:<br>-------------------------------------------------------------------------<br>[root@jvincent-D800 ~]# cd /tmp<br>[root@jvincent-D800 tmp]# echo "hello world" > file.txt<br>
[root@jvincent-D800 tmp]# setfacl -m u::rwx,g::rwx,o::rwx,u:postgres:---,m:--- file.txt<br>[root@jvincent-D800 tmp]# getfacl file.txt<br># file: file.txt<br># owner: root<br># group: root<br>user::rwx<br>user:postgres:---<br>
group::rwx                      #effective:---<br>mask::---<br>other::rwx<br><br>[root@jvincent-D800 tmp]# ls -l file.txt<br>-rwx---rwx+ 1 root root 12 May  7 11:33 file.txt<br><br>[root@jvincent-D800 tmp]# su - postgres<br>
[postgres@jvincent-D800 ~]$ id<br>uid=501(postgres) gid=501(postgres) groups=501(postgres)<br>[postgres@jvincent-D800 ~]$ whoami<br>postgres<br>[postgres@jvincent-D800 ~]$ cat /tmp/file.txt<br>hello world<br>[postgres@jvincent-D800 ~]$<br>
<br><br>Example with -wx permissions for the user ACE:<br>
-------------------------------------------------------------------------<br>[root@jvincent-D800 tmp]# cd /tmp<br>[root@jvincent-D800 tmp]# echo "hello world" > file.txt<br>[root@jvincent-D800 tmp]# setfacl -m u::rwx,g::rwx,o::rwx,u:postgres:-wx,m:rwx file.txt<br>
[root@jvincent-D800 tmp]# getfacl file.txt<br># file: file.txt<br># owner: root<br># group: root<br>user::rwx<br>user:postgres:-wx<br>group::rwx<br>mask::rwx<br>other::rwx<br><br>[root@jvincent-D800 tmp]# ls -l file.txt<br>
-rwxrwxr--+ 1 root root 12 May  7 13:47 file.txt<br>[root@jvincent-D800 tmp]# su - postgres<br>[postgres@jvincent-D800 ~]$ id<br>uid=501(postgres) gid=501(postgres) groups=501(postgres)<br>[postgres@jvincent-D800 ~]$ whoami<br>
postgres<br>[postgres@jvincent-D800 ~]$ cat /tmp/file.txt<br>cat: /tmp/file.txt: Permission denied<br>[postgres@jvincent-D800 ~]$<br><br><br>Thanks!<br><br>Jon<br>