Retourner au contenu associé (entrée de forum : chown récursif avec exclusion de répertoire)
Posté par chboeuf le 24 septembre 2007 à 10:17. En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: Juste find.
Posté par chboeuf . En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
Tout est en root:
[root@ww-noitst15 miles]# ls -la
drwxr-xr-x 4 root root 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
-rw-r--r-- 1 root root 191881 sep 24 10:02 jaxen-full.jar
-rw-r--r-- 1 root root 147698 sep 24 10:02 jdom.jar
-rwxr-x--- 1 root root 21629 sep 24 10:02 local.properties
-rw-r--r-- 1 root root 1739 sep 24 10:00 log4j.properties
drwxr-xr-x 13 root root 4096 sep 24 10:02 MilesRoot
-rwxr-xr-x 1 root root 1352918 sep 24 10:02 ojdbc14.jar
Passage de la commande. MilesRoot a changé de propriétaire.
[root@ww-noitst15 miles]# find ./MilesRoot -not -regex '^./MilesRoot/report*' -exec chown exploit:dba {} \;
[root@ww-noitst15 miles]# ls -la
total 5528
drwxr-xr-x 4 root root 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
-rw-r--r-- 1 root root 191881 sep 24 10:02 jaxen-full.jar
-rw-r--r-- 1 root root 147698 sep 24 10:02 jdom.jar
-rwxr-x--- 1 root root 21629 sep 24 10:02 local.properties
-rw-r--r-- 1 root root 1739 sep 24 10:00 log4j.properties
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 MilesRoot
-rwxr-xr-x 1 root root 1352918 sep 24 10:02 ojdbc14.jar
Le répertoire report n'a pas subit le chown --> normal
[root@ww-noitst15 miles]# cd MilesRoot/
[root@ww-noitst15 MilesRoot]# ls -la
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
drwxr-xr-x 5 exploit dba 4096 sep 24 10:00 batch
drwxr-xr-x 3 exploit dba 4096 sep 24 10:00 command
drwxr-xr-x 95 exploit dba 16384 sep 24 10:02 connectors
drwxr-xr-x 7 exploit dba 102400 sep 24 10:00 documents
drwxr-xr-x 5 exploit dba 4096 sep 24 10:00 milesweb
drwxr-xr-x 3 exploit dba 4096 sep 24 10:02 policy
drwxr-x--- 3 root root 4096 sep 24 10:02 report
drwxr-xr-x 2 exploit dba 4096 sep 24 10:00 schema
-rwxr-xr-x 1 exploit dba 3990100 sep 24 10:00 userStatistics.csv
Son contenu a subit le changement.
[root@ww-noitst15 report]# ls -la
drwxr-x--- 3 root root 4096 sep 24 10:02 .
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 ..
drwxr-x--- 2 exploit dba 4096 sep 24 10:02 2007_06
-rwxr-x--- 1 exploit dba 0 sep 24 10:02 test.log
Je tourne sur une Red Hat ES 4.