lateralblast/lunar

depth option for find in check_file_perms.sh fails

Opened this issue · 1 comments

Ubuntu 16.04

The "-depth 0" option in the find commands on line 34 and line 36 of functions/check_file_perms.sh are invalid and cause errors on Ubuntu systems (possibly others):
find: warning: you have specified the -depth option after a non-option argument -perm, but options are not positional (-depth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
Since the command includes 2> /dev/null this results in the $check_result variable to be blank which causes a false negative when doing file permission and ownership checks while validating against the $check_file parameter.

As per comment, I've merged the fix, thanks. I'll look at how I can do this differently to prevent recursively going down sub directories. This will need a bit of testing as GNU find and BSD find are different, thus the original problem.