Setting Default ACL Does Not Work As Expected

0

I am going to work on a web project and therefore have an www-folder inside $HOME. I want this folder to be owned by user while beloning to group www-data. I issue:

mkdir $HOME/www
chmod g+rxs,u+rwx,o-rwx $HOME/www
chown user.www-data $HOME/www

Then ls -alh | grep www gives:

drwxr-s---  2 user www-data     4,0K Aug 10 17:33 www

Furthermore I want default permissions to be set regardless of the permissions of the creating processes. So I do:

setfacl -m d:u::rwx,d:g::rx,d:o::- $HOME/www

Then getfacl $HOME/www gives:

# file: www
# owner: user
# group: www-data
# flags: -s-
user::rwx
group::r-x
other::---
default:user::rwx
default:group::r-x
default:other::---

Now I cd into the newly created folder an issue:

touch testfile

And then ls -alh | grep testfile gives:

-rw-r-----   1 user www-data    0 Aug 10 17:44 testfile

As you can see the group www-data was inherited due to the setgid bit. But the default ACLs from the directory $HOME/www were not inherited (as I would have expected). $HOME has different default ACLs compared to $HOME/www - but I would expect that manually overriding the subdirectories default ACLs works quite straightforward.

I want the subdirectories and files inside of $HOME/www to have the default permissions as given above. What am I missing here?

fragwürdig

Posted 2016-08-10T15:59:41.867

Reputation: 167

Answers

1

Files by default do not get execute permissions. Directories do. Try creating a directory, it should have the expected permissions. Files should get the expected default permissions minus execute.

Catweazle

Posted 2016-08-10T15:59:41.867

Reputation: 376

The subdirs have the permissions as expected. Since I do not need the x-bit on regular files I am quite happy with this answer. Thanks. – fragwürdig – 2016-08-10T17:11:38.953