Comment 9 for bug 1103022

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This test case shows the bug in udev-acl.c.

When udev-acl is called to add a user acl, it

1. gets the current acl
2. removes any acl for non-current user
3. adds acl for user
4. writes the result.

Any existing group acl is kept.

What this test case shows, is that in step 1 udev will get what looks like a group acl (for zero perms) - even though that was not an acl, it was just the group perms on the inode. Then in step 4, that acl gets written as an explicit acl.

To test, compile the program, touch a file, look at the perms, run this program specifying the file as argument, and re-check the perms:

1. gcc -o acltest acltest.c -lacl
2. echo ab > ab
3. chmod 700 ab
3. ls -l ab; getfacl ab
4. ./acltest ab
5. ls -l ab; getfacl ab

An acl has been added to ab (indicated by '+' in ls output), which was not there before