Rev 7013 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2840 | reyssat | 1 | #! /bin/sh |
2 | |||
3 | # Change file permissions |
||
4 | # used to prepare a new version of wims from svn repository |
||
5 | # and at the end of installation of a new version. |
||
6 | |||
7 | cd `dirname $0`/.. |
||
8 | wimshome=`pwd` |
||
9 | |||
10 | |||
11 | cd $wimshome |
||
12 | dir=`pwd` |
||
13 | echo "Change file permissions in " $wimshome |
||
14 | |||
15 | noread="bin sessions s2 src log log/classes log/forums log/.developers\ |
||
16 | backup tmp/log\ |
||
17 | public_html/bin public_html/msg\ |
||
18 | public_html/bases/dic public_html/bases/sheet\ |
||
19 | public_html/bases/site public_html/bases/sys\ |
||
20 | public_html/bases/doc\ |
||
21 | public_html/scripts/adm\ |
||
22 | public_html/modules/home public_html/modules/adm" |
||
23 | |||
24 | nowrite="public_html README README_rpm HEADER.html download other\ |
||
25 | compile localwims chroot/bin chroot/usr chroot/etc chroot/sbin chroot/lib" |
||
26 | |||
27 | nowrite2="tmp tmp/sessions chroot chroot/tmp/sessions" |
||
28 | |||
29 | noexec="public_html/modules" |
||
30 | |||
31 | users="bin public_html chroot/*" |
||
32 | |||
33 | wexec="other other/lib other/share tmp tmp/forall tmp/sessions -maxdepth 0" |
||
34 | |||
35 | wexec2="other/bin" |
||
36 | |||
37 | # noread : |
||
38 | echo "**************************** noread ****************************" |
||
39 | |||
40 | for f in $noread |
||
41 | do |
||
42 | # permission multiple de 4x16=64 ? (i.e. aucune perm pour group et other) |
||
43 | test=`stat -Lt $f | cut -d' ' -f4 | grep '..[048c]0'` |
||
44 | if [ -e $f ] && [ -z "$test" ]; then |
||
45 | test1=`stat -Lt $f | cut -d' ' -f4` |
||
46 | echo "bad permission " $test1 "for " $dir/$f |
||
47 | chmod og-rwx $f |
||
48 | fi |
||
49 | done |
||
50 | |||
51 | |||
52 | |||
53 | |||
54 | # nowrite : |
||
55 | echo " |
||
56 | |||
57 | |||
58 | **************************** nowrite nowrite2 ****************************" |
||
59 | cd $wimshome |
||
60 | |||
13452 | georgesk | 61 | test=`find $nowrite -perm /22 \! -type l 2>/dev/null | head -20000` |
2844 | reyssat | 62 | # Attention, j'ai remplacé w_nowrite2 par nowrite2 |
13452 | georgesk | 63 | test2=`find $nowrite2 -maxdepth 0 -perm /22 \! -type l 2>/dev/null | head -20000` |
2840 | reyssat | 64 | if [ ! -z "$test$test2" ]; then |
65 | chmod og-w $test $test2 |
||
66 | echo "$test |
||
67 | $test2" | head -10 |
||
68 | echo "........... " |
||
69 | echo "$test |
||
70 | $test2" | tail -10 |
||
71 | fi |
||
72 | NF=`echo "$test$test2" | wc -l` |
||
73 | echo " |
||
74 | Number of nowrite files changed : " $NF |
||
75 | |||
76 | echo " |
||
77 | |||
78 | |||
79 | **************************** noexec noexec2 ****************************" |
||
80 | cd $wimshome |
||
13452 | georgesk | 81 | test=`find $noexec -perm /11 -type f 2>/dev/null | head -20000` |
2840 | reyssat | 82 | if [ ! -z "$test" ]; then |
4293 | bpr | 83 | echo "noexec noexec2" |
2840 | reyssat | 84 | chmod og-x $test |
85 | echo "$test" | head -10 |
||
86 | echo "........... " |
||
87 | echo "$test" | tail -10 |
||
88 | fi |
||
89 | NF=`echo "$test" | wc -l` |
||
90 | echo " |
||
91 | Number of noexec files changed : " $NF |
||
92 | |||
93 | echo " |
||
94 | |||
95 | |||
96 | **************************** users ****************************" |
||
97 | cd $wimshome |
||
98 | i=`id -un` |
||
99 | echo "File which don't belong to wims : " |
||
100 | find $users \! -user $i | head -60 | grep -v '^chroot/usr/bin/\[$' |
||
101 | |||
102 | |||
103 | echo " |
||
104 | |||
105 | |||
106 | **************************** wexec wexec2 ****************************" |
||
107 | cd $wimshome |
||
108 | testd=`find $wexec -follow -type d \! -perm -11 2>/dev/null | head -20000` |
||
109 | testf=`find $wexec2 -follow -type f \! -perm -11 2>/dev/null | head -20000` |
||
110 | test="$testd $testf" |
||
111 | if [ ! -z "$testd$testf" ]; then |
||
112 | chmod a+rx $test; |
||
113 | echo "$test" | head -10 |
||
114 | echo "........... " |
||
115 | echo "$test" | tail -10 |
||
116 | fi |
||
117 | NF=`echo "$test" | wc -l` |
||
118 | echo " |
||
119 | Number of wexec files changed : " $NF |
||
120 | |||
4405 | obado | 121 | echo " |
122 | ************* file permissions changes **************" |
||
4075 | bpr | 123 | cd $wimshome/public_html; for f in \ |
124 | scripts/js/editor/scripts_1/prototype.js \ |
||
125 | gifs/editor/t1.gif \ |
||
126 | scripts/js/editor/names_nl.js \ |
||
127 | html/css/editor/style.css \ |
||
128 | scripts/js/editor/scripts_1/bd_js/latex.js \ |
||
129 | scripts/js/editor/names_en.js \ |
||
130 | scripts/js/editor/names_fr.js \ |
||
131 | scripts/js/editor/scripts_2/control.textarea.2.0.0.RC1.js \ |
||
132 | gifs/editor/t2.gif \ |
||
133 | gifs/editor/markdown_icons.gif \ |
||
134 | gifs/editor/markdown_icons.png \ |
||
135 | gifs/editor/t5.gif \ |
||
136 | scripts/js/editor/scripts_2/jalonJavascriptLibMootools.js \ |
||
137 | gifs/editor/t3.gif \ |
||
138 | scripts/js/editor/names_cn.js \ |
||
139 | scripts/js/editor/scripts_2/gfcursor.js \ |
||
140 | gifs/editor/hud_element_fond.gif \ |
||
141 | gifs/editor/t4.gif \ |
||
142 | scripts/js/editor/scripts_2/fonctions_IE.js \ |
||
143 | scripts/js/editor/scripts_2/control.textarea.markdown.js \ |
||
144 | scripts/js/editor/scripts_2/fonctions_generiques.js \ |
||
145 | html/css/editor/infobulle.css \ |
||
146 | scripts/js/editor/scripts_1/Redimensionne.js \ |
||
147 | scripts/js/editor/scripts_2/jalonJavascriptUtils.js \ |
||
148 | scripts/js/editor/scripts_2/fonctions_Mozilla.js \ |
||
149 | scripts/js/editor/scripts_2/jalonJavascriptHUD.js \ |
||
150 | scripts/js/editor/JSeditor.js \ |
||
151 | html/css/editor/jalonStylesHUD.css \ |
||
152 | scripts/js/editor/scripts_2/javascript_002.js \ |
||
153 | gifs/themes/wimsedu/rss_new.png \ |
||
154 | gifs/themes/wimsedu/rss_modif.png \ |
||
155 | java/geogebra3/essai.html \ |
||
156 | java/geogebra3/essai.ggb \ |
||
157 | scripts/js/wz_tooltip.js \ |
||
158 | scripts/js/speck/speck.css \ |
||
159 | scripts/js/speck/speck.gif \ |
||
160 | scripts/js/speck/editstyle.css \ |
||
161 | scripts/js/speck/speck.js \ |
||
162 | scripts/js/speck/index.htm; do \ |
||
4293 | bpr | 163 | chmod -x $f; done |
2840 | reyssat | 164 | |
165 | echo "end of changing file permissions in " $wimshome |