Note exercices, little rework for the book

This commit is contained in:
nemunaire 2022-04-08 22:39:14 +02:00
commit bbd704d413
29 changed files with 210 additions and 120 deletions

View file

@ -68,17 +68,17 @@ depuis un conteneur, par exemple :
<div lang="en-US">
```
42sh$ docker run -it --rm alpine
42sh$ docker run -it --rm alpine
(ctnr)# apk add --no-cache acl iputils
(1/4) Installing libacl (2.2.53-r0)
(2/4) Installing acl (2.2.53-r0)
(3/4) Installing libcap (2.50-r0)
(4/4) Installing iputils (20210202-r0)
(ctnr)# apk add --no-cache acl iputils
(1/4) Installing libacl (2.2.53-r0)
(2/4) Installing acl (2.2.53-r0)
(3/4) Installing libcap (2.50-r0)
(4/4) Installing iputils (20210202-r0)
(ctnr)# su -s/bin/ash daemon
(ctnr)# su -s/bin/ash daemon
(ctnr)$ _
(ctnr)$ _
```
</div>
@ -87,10 +87,10 @@ tests en retirant le *setuid* :
<div lang="en-US">
```
(ctnr)# chmod u-s /bin/ping
(ctnr)# chmod u-s /bin/ping
(ctnr)$ ping epita.fr
ping: socket: Operation not permitted
(ctnr)$ ping epita.fr
ping: socket: Operation not permitted
```
</div>
@ -98,10 +98,10 @@ Puis en ajoutant la *capability* :
<div lang="en-US">
```
(ctnr)# setcap cap_net_raw+p /bin/ping
(ctnr)# setcap cap_net_raw+p /bin/ping
(ctnr)$ ping epita.fr
PING epita.fr (172.67.156.141) 56(84) bytes of data.
(ctnr)$ ping epita.fr
PING epita.fr (172.67.156.141) 56(84) bytes of data.
```
</div>
@ -200,8 +200,9 @@ du fichier ; et on peut l'afficher dans sa version plus lisible :
```
</div>
::::: {.exercice}
### Exercice : visualisateur de capabilities d'un processus {-}
### Visualisateur de capabilities d'un processus {-}
Écrivons maintenant un programme permettant de voir les *capabilities*
d'un processus :
@ -241,6 +242,7 @@ courant.
Astuces : `capget(2)`, X-macros, ...
:::::
### Pour aller plus loin {-}