4

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.

vaab
  • 512
  • 3
  • 13
  • 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 07 '12 at 19:45

2 Answers2

1

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::---
Andrew Smith
  • 1,123
  • 13
  • 23
0

Do you mean something like this?

setfacl -m g::x FILE
Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78
  • 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 07 '12 at 08:45