Fixed permission errors on .gvfs virtual filesystems. Bumped to version 0.21

Tue, 15 Apr 2014 14:45:38 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 15 Apr 2014 14:45:38 +0200
changeset 20
1d18ebb9e279
parent 19
2c0dacb26b14
child 21
735fe1b89e5a

Fixed permission errors on .gvfs virtual filesystems. Bumped to version 0.21

cron.daily/security file | annotate | diff | comparison | revisions
security.d/chk_homespace file | annotate | diff | comparison | revisions
security.d/chk_setid file | annotate | diff | comparison | revisions
--- a/cron.daily/security	Mon Jan 20 12:48:38 2014 +0100
+++ b/cron.daily/security	Tue Apr 15 14:45:38 2014 +0200
@@ -22,7 +22,7 @@
 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 #############################################################################
 
-VERSION=0.20
+VERSION=0.21
 export PATH=/bin:/usr/bin:/sbin:/usr/sbin
 umask 077
 LANG=C; export LANG
@@ -34,7 +34,7 @@
     MAILTO=root
 fi
 
-DAILYDIR=`mktemp -d /tmp/_daily.XXXXXX` || exit 1
+DAILYDIR=$(mktemp -d /tmp/_daily.XXXXXX) || exit 1
 SECOUT="$DAILYDIR/secout"
 TMP1="$DAILYDIR/tmp1"
 
--- a/security.d/chk_homespace	Mon Jan 20 12:48:38 2014 +0100
+++ b/security.d/chk_homespace	Tue Apr 15 14:45:38 2014 +0200
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 #############################################################################
-# Copyright (C) 2005-2013
+# Copyright (C) 2005-2014
 #   
 # Michiel Broek               <mbse at mbse.eu>
 #
@@ -30,7 +30,7 @@
 MP=/etc/passwd
 LANG=C; export LANG
 
-SECUREDIR=`mktemp -d /tmp/_securedir.XXXXXX` || exit 1
+SECUREDIR=$(mktemp -d /tmp/_securedir.XXXXXX) || exit 1
 
 trap "/bin/rm -rf $SECUREDIR ; exit 0" EXIT INT QUIT PIPE
 
@@ -50,8 +50,8 @@
 
 while read name uid  homedir; do
     if [ -d ${homedir}/ ] && [ "`expr $uid \>= 1000`" == "1" ]; then
-	USAGE=`du -s --block-size=1048576 -h $homedir | cut -f 1`
-	SPACE=`df -khTP $homedir | tail -n 1 | awk '{ print $3 }'`
+	USAGE=$(du -s --block-size=1048576 -h $homedir 2>/dev/null | cut -f 1)
+	SPACE=$(df -khTP $homedir | tail -n 1 | awk '{ print $3 }')
 	printf -- "%-16s  %6s  %6s  $homedir\n" $name $USAGE $SPACE
     fi
 done < $MPBYPATH > $OUTPUT
--- a/security.d/chk_setid	Mon Jan 20 12:48:38 2014 +0100
+++ b/security.d/chk_setid	Tue Apr 15 14:45:38 2014 +0200
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 #############################################################################
-# Copyright (C) 2005-2013
+# Copyright (C) 2005-2014
 #   
 # Michiel Broek               <mbse at mbse.eu>
 #
@@ -28,7 +28,7 @@
 TZ=UTC; export TZ
 LANG=C; export LANG
 
-SECUREDIR=`mktemp -d /tmp/_securedir.XXXXXX` || exit 1
+SECUREDIR=$(mktemp -d /tmp/_securedir.XXXXXX) || exit 1
 
 trap "/bin/rm -rf $SECUREDIR ; exit 0" EXIT INT QUIT PIPE
 
@@ -50,14 +50,14 @@
 
 if [ ! -f $CURR ]; then
     # No database, install new database
-    find $FSS \( -mount \( -perm -u+s -a ! -type d \) -o \( -perm -g+s -a ! -type d \) \) -print0 | \
+    find $FSS \( -mount \( -perm -u+s -a ! -type d \) -o \( -perm -g+s -a ! -type d \) \) -print0 2>/dev/null | \
 	xargs -0 /bin/ls -ld --full-time | sort -k9 > $CURR
     exit
 fi
 
 # Database is present, create temp database
 #
-find $FSS \( -mount \( -perm -u+s -a ! -type d \) -o \( -perm -g+s -a ! -type d \) \) -print0 | \
+find $FSS \( -mount \( -perm -u+s -a ! -type d \) -o \( -perm -g+s -a ! -type d \) \) -print0 2>/dev/null | \
     xargs -0 /bin/ls -ld --full-time | sort -k9 > $TMP1
 changed=0
 

mercurial