WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Test all mounted extensions for correct tce.installed  (Read 2339 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10070
Test all mounted extensions for correct tce.installed
« on: February 27, 2010, 04:19:05 AM »
Jason's audit one handles most things, and fixes; this is a light, check-only alternative. Useful for non-extension makers to pinpoint which extension has the wrong permissions/owner.

Quote
#!/bin/sh
# Tests all mounted extensions for correct tce.installed

cd /tmp/tcloop

for i in *; do
   if [ -d "$i"/usr/local/tce.installed ]; then
      OUT=$(busybox ls -d -l "$i"/usr/local/tce.installed)
      PERM=$(echo $OUT | cut -d" " -f1)
      OWNER=$(echo $OUT | cut -d" " -f3-4)

      [ "$PERM" != "drwxrwxr-x" ] && [ "$PERM" != "drwxrwsr-x" ] && echo Wrong perms on "$i"
      [ "$OWNER" != "root staff" ] && echo Wrong owner on "$i"
   fi
done

March 3rd: updated with g+s check
« Last Edit: March 03, 2010, 07:13:33 AM by curaga »
The only barriers that can stop you are the ones you create yourself.