@@ -196,20 +196,20 @@ function fix_code_permission_helper() {
196
196
case $simulate in
197
197
0)
198
198
# Real action.
199
- find " $1 " $detected_vendor_path \( -path " $1 " /sites/* /$file_folder_name -prune \) -o \( -path " $1 " /sites/* /$private_folder_name -prune \) -o \( -type $2 ! -perm $3 -print0 \) | xargs -r -0 -L4 chmod $3
199
+ find " $1 " \( -path " $1 " /sites/* /$file_folder_name -prune \) -o \( -path " $1 " /sites/* /$private_folder_name -prune \) -o \( -type $2 ! -perm $3 -print0 \) | xargs -r -0 -L4 chmod $3
200
200
;;
201
201
202
202
1)
203
203
# Simulate.
204
- num=$( find " $1 " $detected_vendor_path \( -path " $1 " /sites/* /$file_folder_name -prune \) -o \( -path " $1 " /sites/* /$private_folder_name -prune \) -o \( -type $2 ! -perm $3 -print \) | wc -l)
204
+ num=$( find " $1 " \( -path " $1 " /sites/* /$file_folder_name -prune \) -o \( -path " $1 " /sites/* /$private_folder_name -prune \) -o \( -type $2 ! -perm $3 -print \) | wc -l)
205
205
printf " \n Code items with wrong permissions: $num "
206
206
;;
207
207
208
208
2)
209
209
# Simulate verbosely.
210
210
printf " \n Code files and directories that would have their permissions fixed: "
211
211
# Use a variable to indent output.
212
- items=$( find " $1 " $detected_vendor_path \( -path " $1 " /sites/* /$file_folder_name -prune \) -o \( -path " $1 " /sites/* /$private_folder_name -prune \) -o \( -type $2 ! -perm $3 -print \) )
212
+ items=$( find " $1 " \( -path " $1 " /sites/* /$file_folder_name -prune \) -o \( -path " $1 " /sites/* /$private_folder_name -prune \) -o \( -type $2 ! -perm $3 -print \) )
213
213
items=${items:- None}
214
214
printf " \n ${items// $' \n ' / $' \n ' } \n"
215
215
;;
@@ -268,6 +268,16 @@ function fix_code_permissions() {
268
268
printf " \n Setting permissions on code files to $code_file_perms under '$name '"
269
269
fix_code_permission_helper " $1 " f " $code_file_perms "
270
270
271
+
272
+ if [ ! -z " $detected_vendor_path " ]
273
+ then
274
+ printf " \n Setting permissions on vendor code directories to $code_dir_perms under '$detected_vendor_path '"
275
+ fix_code_permission_helper " $detected_vendor_path " d " $code_dir_perms "
276
+
277
+ printf " \n Removing all permissions on vendor code files to other users ($vendor_code_file_perms ) under '$detected_vendor_path '"
278
+ fix_code_permission_helper " $detected_vendor_path " f " $vendor_code_file_perms "
279
+ fi
280
+
271
281
}
272
282
273
283
368
378
# content files).
369
379
code_dir_perms=' u=rwx,g=rx,o='
370
380
code_file_perms=' u=rw,g=r,o='
381
+ vendor_code_file_perms=' o='
371
382
content_dir_perms=" u=rwx,g=rw${group_executable_mode} ,o="
372
383
content_file_perms=' ug=rw,o='
373
384
0 commit comments