Sto cercando di capire la differenza di comportamento tra ACL di FreeBSD e ACL di Linux. In particolare, il meccanismo di ereditarietà per gli ACL predefiniti.
Ho usato quanto segue sia su Debian 9.6 sia su FreeBSD 12:
$ cat test_acl.sh
#!/bin/sh
set -xe
mkdir storage
setfacl -d -m u::rwx,g::rwx,o::-,m::rwx storage
touch outside
cd storage
touch inside
cd ..
ls -ld outside storage storage/inside
getfacl -d storage
getfacl storage
getfacl outside
getfacl storage/inside
umask
Ottengo il seguente output da Debian 9.6:
$ ./test_acl.sh
+ mkdir storage
+ setfacl -d -m u::rwx,g::rwx,o::-,m::rwx storage
+ touch outside
+ cd storage
+ touch inside
+ cd ..
+ ls -ld outside storage storage/inside
-rw-r--r-- 1 aaa aaa 0 Dec 28 11:16 outside
drwxr-xr-x+ 2 aaa aaa 4096 Dec 28 11:16 storage
-rw-rw----+ 1 aaa aaa 0 Dec 28 11:16 storage/inside
+ getfacl -d storage
# file: storage
# owner: aaa
# group: aaa
user::rwx
group::rwx
mask::rwx
other::---
+ getfacl storage
# file: storage
# owner: aaa
# group: aaa
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::rwx
default:mask::rwx
default:other::---
+ getfacl outside
# file: outside
# owner: aaa
# group: aaa
user::rw-
group::r--
other::r--
+ getfacl storage/inside
# file: storage/inside
# owner: aaa
# group: aaa
user::rw-
group::rwx #effective:rw-
mask::rw-
other::---
+ umask
0022
Si noti che i file outsidee insidehanno autorizzazioni diverse. In particolare, il outsidefile ha -rw-r--r--, che è l'impostazione predefinita per questo utente e il insidefile ha -rw-rw----, rispettando gli ACL predefiniti che ho assegnato alla storagedirectory.
L'output dello stesso script su FreeBSD 12:
$ ./test_acl.sh
+ mkdir storage
+ setfacl -d -m u::rwx,g::rwx,o::-,m::rwx storage
+ touch outside
+ cd storage
+ touch inside
+ cd ..
+ ls -ld outside storage storage/inside
-rw-r--r-- 1 aaa aaa 0 Dec 28 03:16 outside
drwxr-xr-x 2 aaa aaa 512 Dec 28 03:16 storage
-rw-r-----+ 1 aaa aaa 0 Dec 28 03:16 storage/inside
+ getfacl -d storage
# file: storage
# owner: aaa
# group: aaa
user::rwx
group::rwx
mask::rwx
other::---
+ getfacl storage
# file: storage
# owner: aaa
# group: aaa
user::rwx
group::r-x
other::r-x
+ getfacl outside
# file: outside
# owner: aaa
# group: aaa
user::rw-
group::r--
other::r--
+ getfacl storage/inside
# file: storage/inside
# owner: aaa
# group: aaa
user::rw-
group::rwx # effective: r--
mask::r--
other::---
+ umask
0022
(Nota che Debian getfaclmostrerà anche gli ACL predefiniti anche quando non usa -ddove FreeBSD non lo fa, ma non credo che gli ACL effettivi storagesiano diversi.)
Qui, i file outsidee insidehanno anche permessi diversi, ma il insidefile non ha il permesso di scrittura di gruppo della versione Debian, probabilmente perché la maschera in Debian ha mantenuto il wmentre la maschera in FreeBSD ha perso il w.
Perché FreeBSD ha perso la wmaschera ma Debian l'ha conservata?
g+s)?
getfaclinformazioni.
storage, ls dovrebbe mostrare+ , allo stesso modo mi aspetto che l' getfacloutput sia simile a quello che hai sul sistema Debian. È stato setfaclrestituito il codice di uscita riuscito?
getfacl storagemostra su entrambi i sistemi?