Lorsque je lance la commande :
pids=$(pgrep -f "server.py");for f in
/proc/$pids/fdinfo/*;do cat $f | grep flags | grep -q -v
400[0,1,2] && ls -al;/proc/$pids/fd/$(basename
$f); done;
J'ai en résultat :
total 100
drwx------ 6 root root 4096 oct. 22 10:45 .
drwxr-xr-x 25 root root 4096 oct. 17 14:11 ..
-rw------- 1 root root 33699 oct. 22 10:27 .bash_history
-rw-r--r-- 1 root root 3523 mars 6 2019 .bashrc
drwx------ 2 root root 4096 mars 5 2019 .cache
drwx------ 3 root root 4096 mars 20 2019 .config
-rw------- 1 root root 67 oct. 21 13:31 .lesshst
drwxr-xr-x 2 root root 4096 mai 6 09:57 .nano
-rw-r--r-- 1 root root 148 août 17 2015 .profile
-rw------- 1 root root 1024 avril 4 2019 .rnd
drwxr----- 2 root root 4096 mars 7 2019 .ssh
-rw------- 1 root root 13320 oct. 22 10:45 .viminfo
-rw-r--r-- 1 root root 171 mars 7 2019 .wget-hsts
-bash: /proc/46480/fd/0: Permission non accordée
total 100
drwx------ 6 root root 4096 oct. 22 10:45 .
drwxr-xr-x 25 root root 4096 oct. 17 14:11 ..
-rw------- 1 root root 33699 oct. 22 10:27 .bash_history
-rw-r--r-- 1 root root 3523 mars 6 2019 .bashrc
drwx------ 2 root root 4096 mars 5 2019 .cache
drwx------ 3 root root 4096 mars 20 2019 .config
-rw------- 1 root root 67 oct. 21 13:31 .lesshst
drwxr-xr-x 2 root root 4096 mai 6 09:57 .nano
-rw-r--r-- 1 root root 148 août 17 2015 .profile
-rw------- 1 root root 1024 avril 4 2019 .rnd
drwxr----- 2 root root 4096 mars 7 2019 .ssh
-rw------- 1 root root 13320 oct. 22 10:45 .viminfo
-rw-r--r-- 1 root root 171 mars 7 2019 .wget-hsts
-bash: /proc/46480/fd/1: Permission non accordée
-bash: /proc/46480/fd/10: Permission non accordée
-bash: /proc/46480/fd/100: Permission non accordée
...
pgrep -f "server.py" me donne bien le
pid.
pids=$(pgrep -f "server.py");for f in
/proc/$pids/fdinfo/*;do cat $f | grep flags;done
me donne bien les flags :
...
flags: 04002
flags: 04002
flags: 02100000
flags: 04002
flags: 04002
flags: 04002
flags: 04002
flags: 04002
flags: 04002
flags: 04002
...
pids=$(pgrep -f "server.py");for f in
/proc/$pids/fdinfo/*;do cat $f | grep flags | grep -q -v
400[0,1,2];done ne me retourne rien
pids=$(pgrep -f "server.py");for f in
/proc/$pids/fdinfo/*;do cat $f | grep flags | grep -q -v
400[0,1,2] && ls -al;done
total 0
total 0
total 0
total 0
total 0
total 0
Frédéric GARESCHÉ
Équipe Assistance et Exploitation
Direction du Système d'Information
(D.S.I)
Correspondant Département EII et
laboratoire IETR
Tél. : +33 (0)2 23 23 82 81
20
avenue des Buttes de Coësmes
CS
70839 - 35 708 RENNES Cedex 7