Update 2018

This commit is contained in:
nemunaire 2018-10-22 16:49:38 +02:00
commit b2b5c1c0eb
12 changed files with 197 additions and 185 deletions

View file

@ -79,11 +79,11 @@ Par exemple, on peut définir un attribut sur un fichier comme cela :
<div lang="en-US">
```shell
42sh$ echo 'Hello World!' > toto
42sh$ setfattr -n user.foo -v bar toto
42sh$ getfattr -d toto
# file: toto
user.foo="bar"
42sh$ echo 'Hello World!' > toto
42sh$ setfattr -n user.foo -v bar toto
42sh$ getfattr -d toto
# file: toto
user.foo="bar"
```
</div>
@ -91,12 +91,12 @@ Encore plus fort, vous pouvez utiliser les ACL POSIX :
<div lang="en-US">
```shell
42sh$ sudo chown root:root toto && sudo chmod o-r toto
42sh$ cat toto
cat: toto: Permission denied
42sh$ sudo setfattr -m u:$USER:r toto
42sh$ cat toto
Hello World!
42sh$ sudo chown root:root toto && sudo chmod o-r toto
42sh$ cat toto
cat: toto: Permission denied
42sh$ sudo setfattr -m u:$USER:r toto
42sh$ cat toto
Hello World!
```
</div>
@ -107,9 +107,9 @@ Vous pouvez voir ces attributs avec la commande :
<div lang="en-US">
```shell
42sh$ getfattr -d -m "^system" toto
# file: toto
system.posix_acl_access=0sgAAEAD/////AgAEOgDAEAA/////xAABAD////8=
42sh$ getfattr -d -m "^system" toto
# file: toto
system.posix_acl_access=0sgAAEAD/////AgAEOgDAEAA/////xAABAD////8=
```
</div>
@ -127,9 +127,9 @@ Si votre distribution profite de ces attributs étendus, vous devriez obtenir :
<div lang="en-US">
```shell
42sh$ getfattr -d -m "^security" $(which ping)
# file: bin/ping
security.capability=0sAQAAAgAgAAAAAAAAAAAAAAAAAAA=
42sh$ getfattr -d -m "^security" $(which ping)
# file: bin/ping
security.capability=0sAQAAAgAgAAAAAAAAAAAAAAAAAAA=
```
</div>
@ -137,8 +137,8 @@ Ou, dans sa version plus lisible :
<div lang="en-US">
```shell
42sh$ getcap $(which ping)
/bin/ping = cap_net_raw+ep
42sh$ getcap $(which ping)
/bin/ping = cap_net_raw+ep
```
</div>
@ -150,31 +150,31 @@ d'un processus :
<div lang="en-US">
```shell
42sh$ ./view_caps 1
cap_user_header_t
-----------------
Version: 20080522
PID: 1
42sh$ ./view_caps 1
cap_user_header_t
-----------------
Version: 20080522
PID: 1
cap_user_data_t
---------------
effective: 0x3fffffffff
CAP_AUDIT_CONTROL
CAP_AUDIT_READ
[...]
CAP_SYS_TIME
CAP_SYS_TTY_CONFIG
CAP_SYSLOG
CAP_WAKE_ALARM
permitted: 0x3fffffffff
CAP_AUDIT_CONTROL
CAP_AUDIT_READ
[...]
CAP_SYS_TIME
CAP_SYS_TTY_CONFIG
CAP_SYSLOG
CAP_WAKE_ALARM
inheritable: 0x0
cap_user_data_t
---------------
effective: 0x3fffffffff
CAP_AUDIT_CONTROL
CAP_AUDIT_READ
[...]
CAP_SYS_TIME
CAP_SYS_TTY_CONFIG
CAP_SYSLOG
CAP_WAKE_ALARM
permitted: 0x3fffffffff
CAP_AUDIT_CONTROL
CAP_AUDIT_READ
[...]
CAP_SYS_TIME
CAP_SYS_TTY_CONFIG
CAP_SYSLOG
CAP_WAKE_ALARM
inheritable: 0x0
```
</div>