Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using setfacl command line arguments, is there a way to set/unset a single flag as the following command will do ?

chmod g+x FILE

Please note that:

setfacl g::x   FILE
setfacl g::--x FILE

are equivalent and will set executable bit and remove read a write flag. And thus these commands are not setting/unsetting an individual flag but 3 flags at once.

share|improve this question
    
Using effective rights mask setfacl -m m::rw FILE - off, and setfacl -m m::rwx FILE - on - and this way with setfacl is designed to work like –  Andrew Smith Jul 7 '12 at 19:45
add comment

2 Answers

What about using effective rights mask:

[test@abcdef ~]$ setfacl -m g::rwx test/
[test@abcdef ~]$ getfacl test/
# file: test/
# owner: test
# group: test
user::rwx
group::rwx
mask::rwx
other::---

[test@abcdef ~]$ setfacl -m m::rw test/
[test@abcdef ~]$ getfacl test/
# file: test/
# owner: test
# group: test
user::rwx
group::rwx                      #effective:rw-
mask::rw-
other::---
share|improve this answer
add comment

Do you mean something like this?

setfacl -m g::x FILE
share|improve this answer
    
No, this won't change only the executable permission. Your proposed command is equivalent to setfacl -m g::--x FILE: setting executable bit BUT REMOVING read and write flag. –  vaab Jul 7 '12 at 8:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.