Commits

Ivan Vučica committed 7df971a

Wrote down that 'stat' should be used to get permissions and ownership of a file

  • Participants
  • Parent commits ff2d1a1

Comments (0)

Files changed (1)

 
 # Does the bundle contain files with incorrect permissions?[3]
 # All files should be owned by current user (output of whoami).
+# TODO use 'stat' instead of ls+awk; on linux, stat -c %U
 cd "$APPPATH"
 INCORRECTLY_OWNED_FILES="`find . -exec ls -al '{}' ';' | awk '{ print $3 } ' | grep -v \`whoami\` | grep -v '^$'`"
 if [ ! -z "$INCORRECTLY_OWNED_FILES" ] ; then
 	VALIDATED=0
 	REASON="${REASON}Files owned by incorrect user found in the bundle.\n"
 fi
+# TODO use 'stat' instead of ls+awk; on linux, stat -c %a
 UNREADABLE_FILES="`find . -exec ls -al '{}' ';' | awk '{ print $1 } ' | grep -e '^.--.*'`"
 if [ ! -z "$UNREADABLE_FILES" ] ; then
 	echo "== FILES UNREADABLE BY OWNER FOUND"