File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed
Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1515# limitations under the License.
1616#
1717
18+ #include file/is_world_readable
19+ #include file/is_world_executable
20+
1821# file::is_world_accessible
1922# Checks if a file or directory is world-readable and executable.
2023#
@@ -40,7 +43,7 @@ function file::is_world_accessible() {
4043
4144 if [[ ! -d "$path" ]]; then
4245 mode=$(stat -c "%a" "$path")
43- if file::is_world_readable "$path"; then
46+ if ! file::is_world_readable "$path"; then
4447 return 1
4548 fi
4649
Original file line number Diff line number Diff line change 3333# status (false).
3434function file::is_world_executable() {
3535 local path=${1:?st argument (path) must be set}
36- [[ -n $(find "$path" -perm -005) ]]
36+ [[ -n $(find "$path" -maxdepth 0 - perm -005) ]]
3737}
Original file line number Diff line number Diff line change 3333# status (false).
3434function file::is_world_readable() {
3535 local path=${1:?st argument (path) must be set}
36- [[ -n $(find "$path" -perm -004) ]]
36+ [[ -n $(find "$path" -maxdepth 0 - perm -004) ]]
3737}
Original file line number Diff line number Diff line change 3333# status (false).
3434function file::is_world_writable() {
3535 local path=${1:?st argument (path) must be set}
36- [[ -n $(find "$path" -perm -002) ]]
36+ [[ -n $(find "$path" -maxdepth 0 - perm -002) ]]
3737}
You can’t perform that action at this time.
0 commit comments