| 
      
      
      From: <ssm...@us...> - 2007-01-09 20:40:43
       | 
| Revision: 2161
          http://svn.sourceforge.net/selinux/?rev=2161&view=rev
Author:   ssmalley
Date:     2007-01-09 12:40:39 -0800 (Tue, 09 Jan 2007)
Log Message:
-----------
Author: Daniel J Walsh
Email: dw...@re...
Subject: Fixfiles patch for creating logfile fixed.
Date: Tue, 09 Jan 2007 10:19:01 -0500
Modified Paths:
--------------
    trunk/policycoreutils/scripts/fixfiles
Modified: trunk/policycoreutils/scripts/fixfiles
===================================================================
--- trunk/policycoreutils/scripts/fixfiles	2007-01-08 20:45:13 UTC (rev 2160)
+++ trunk/policycoreutils/scripts/fixfiles	2007-01-09 20:40:39 UTC (rev 2161)
@@ -29,6 +29,9 @@
 RPMILES=""
 OUTFILES=""
 LOGFILE=`tty`
+if [ $? != 0 ]; then
+    LOGFILE="/dev/null"
+fi
 SYSLOGFLAG="-l"
 LOGGER=/usr/sbin/logger
 SETFILES=/sbin/setfiles
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ssm...@us...> - 2007-12-07 19:57:48
       | 
| Revision: 2699
          http://selinux.svn.sourceforge.net/selinux/?rev=2699&view=rev
Author:   ssmalley
Date:     2007-12-07 11:57:46 -0800 (Fri, 07 Dec 2007)
Log Message:
-----------
Author: Daniel J Walsh
Email: dw...@re...
Subject: policycoreutils patch
Date: Thu, 06 Dec 2007 13:34:38 -0500
The first patch to fixfiles, eliminates the verbose updates when doing a
diff with an old file context.  This was potentially causing lots of
messages in yum updates and caused an error during update.
Also better handling of arguments when passed into fixfiles.
Modified Paths:
--------------
    trunk/policycoreutils/scripts/fixfiles
Modified: trunk/policycoreutils/scripts/fixfiles
===================================================================
--- trunk/policycoreutils/scripts/fixfiles	2007-12-07 19:54:53 UTC (rev 2698)
+++ trunk/policycoreutils/scripts/fixfiles	2007-12-07 19:57:46 UTC (rev 2699)
@@ -92,7 +92,7 @@
 		      ! \( -fstype ext2 -o -fstype ext3 -o -fstype jfs -o -fstype xfs \) -prune  -o \
 		      \( -wholename /home -o -wholename /root -o -wholename /tmp -wholename /dev \) -prune -o -print; \
 		      done 2> /dev/null | \
-	 ${RESTORECON} $2 -v -f - 
+	 ${RESTORECON} $2 -f - 
 	rm -f ${TEMPFILE} ${PREFCTEMPFILE}
 fi
 }
@@ -189,21 +189,27 @@
     case "$i" in
 	f)
 		fullFlag=1
+		shift 1
 		;;
         R)
 		RPMFILES=$OPTARG
+		shift 2
 		;;
         o)
 		OUTFILES=$OPTARG
+		shift 2
 		;;
         l)
 		LOGFILE=$OPTARG
+		shift 2
 		;;
         C)
 		PREFC=$OPTARG
+		shift 2
 		;;
 	F)
 		FORCEFLAG="-F"
+		shift 1
 		;;
 	*)
 	    usage
@@ -211,10 +217,8 @@
 esac
 done
 
-
 # Check for the command
-eval command=\$${OPTIND}
-let OPTIND=$OPTIND+1
+command=$1
 if [ -z $command ]; then
     usage
 fi
@@ -223,17 +227,15 @@
 # check if they specified both DIRS and RPMFILES
 #
 
+shift 1
 if [ ! -z "$RPMFILES" ]; then
-    if [ $OPTIND -le $# ]; then
+    if [ $# -gt 0 ]; then
 	    usage
     fi
 else
-    while [ $OPTIND -le $# ]; do
-	eval DIR=\$${OPTIND}
-	DIRS="$DIRS $DIR"
-	let OPTIND=$OPTIND+1
-    done
+    DIRS=$*
 fi
+
 #
 # Make sure they specified one of the three valid commands
 #
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ssm...@us...> - 2008-01-24 20:37:22
       | 
| Revision: 2754
          http://selinux.svn.sourceforge.net/selinux/?rev=2754&view=rev
Author:   ssmalley
Date:     2008-01-24 12:37:02 -0800 (Thu, 24 Jan 2008)
Log Message:
-----------
Author: Marshall Miller
Email: mm...@tr...
Subject: fixfiles -C: relabel all file contexts that have changed
Date: Thu, 24 Jan 2008 14:39:40 -0500
This fixes the situation where one path is a substring of another path, but not a prefix.  For example, if /lib and /var/lib have both changed in the file_contexts file, then /var/lib would not be selected for relabel even though it should.
Marshall Miller
Modified Paths:
--------------
    trunk/policycoreutils/scripts/fixfiles
Modified: trunk/policycoreutils/scripts/fixfiles
===================================================================
--- trunk/policycoreutils/scripts/fixfiles	2008-01-24 20:29:37 UTC (rev 2753)
+++ trunk/policycoreutils/scripts/fixfiles	2008-01-24 20:37:02 UTC (rev 2754)
@@ -84,7 +84,7 @@
 	    do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then \
                   echo "$pattern"; \
                   case "$pattern" in *"*") \
-	               echo "$pattern" | sed 's,\*$,,g' >> ${TEMPFILE};;  
+	               echo "$pattern" | sed -e 's,^,^,' -e 's,\*$,,g' >> ${TEMPFILE};;  
                   esac; \
                fi; \
             done | \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ssm...@us...> - 2008-01-25 19:00:52
       | 
| Revision: 2760
          http://selinux.svn.sourceforge.net/selinux/?rev=2760&view=rev
Author:   ssmalley
Date:     2008-01-25 11:00:51 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
Author: Marshall Miller
Email: mm...@tr...
Subject: fixfiles -C: behave as advertised
Date: Thu, 24 Jan 2008 16:25:17 -0500
This patch makes fixfiles -C <file> (restore|check|verify|relabel) behave as advertised.
Marshall Miller
Modified Paths:
--------------
    trunk/policycoreutils/scripts/fixfiles
Modified: trunk/policycoreutils/scripts/fixfiles
===================================================================
--- trunk/policycoreutils/scripts/fixfiles	2008-01-25 18:58:56 UTC (rev 2759)
+++ trunk/policycoreutils/scripts/fixfiles	2008-01-25 19:00:51 UTC (rev 2760)
@@ -92,7 +92,7 @@
 		      ! \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o -fstype ext4dev  -o -fstype gfs2 -o -fstype jfs -o -fstype xfs \) -prune  -o \
 		      \( -wholename /home -o -wholename /root -o -wholename /tmp -wholename /dev \) -prune -o -print0"; \
 		      done 2> /dev/null | \
-	 ${RESTORECON} $2 -0 -f - 
+	 ${RESTORECON} $* -0 -f - 
 	rm -f ${TEMPFILE} ${PREFCTEMPFILE}
 fi
 }
@@ -117,7 +117,7 @@
 #
 restore () {
 if [ ! -z "$PREFC" ]; then
-    diff_filecontext $1
+    diff_filecontext $*
     exit $?
 fi
 if [ ! -z "$RPMFILES" ]; then
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ssm...@us...> - 2008-02-08 16:14:58
       | 
| Revision: 2798
          http://selinux.svn.sourceforge.net/selinux/?rev=2798&view=rev
Author:   ssmalley
Date:     2008-02-08 08:14:55 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
Author: V?\195?\161clav Ovs?\195?\173k
Email: vaclav.ovsik@i.cz
Subject: fixfiles: broken option processing?
Date: Fri, 8 Feb 2008 09:29:22 +0100
On Thu, Feb 07, 2008 at 04:28:03PM -0500, Stephen Smalley wrote:
> Hmm..the shifting of arguments was introduced in r2699 from Dan Walsh
> (cc'd), diff is below.  Also relevant are r2736, r2750 and r2760.
> 
> I'd agree that we don't want to break existing usage, but I'm not sure
> what the least intrusive and cleanest fix is.
Ok. What about this patch :)
The interpreter is changed to /bin/bash.  There are bashisms (getopts,
PIPESTATUS...), so this can't be interpreted by /bin/sh.
Acked-by:  Stephen Smalley <sd...@ty...>
Modified Paths:
--------------
    trunk/policycoreutils/scripts/fixfiles
Modified: trunk/policycoreutils/scripts/fixfiles
===================================================================
--- trunk/policycoreutils/scripts/fixfiles	2008-02-08 16:13:33 UTC (rev 2797)
+++ trunk/policycoreutils/scripts/fixfiles	2008-02-08 16:14:55 UTC (rev 2798)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # fixfiles
 #
 # Script to restore labels on a SELinux box
@@ -201,27 +201,21 @@
     case "$i" in
 	f)
 		fullFlag=1
-		shift 1
 		;;
         R)
 		RPMFILES=$OPTARG
-		shift 2
 		;;
         o)
 		OUTFILES=$OPTARG
-		shift 2
 		;;
         l)
 		LOGFILE=$OPTARG
-		shift 2
 		;;
         C)
 		PREFC=$OPTARG
-		shift 2
 		;;
 	F)
 		FORCEFLAG="-F"
-		shift 1
 		;;
 	*)
 	    usage
@@ -229,17 +223,22 @@
 esac
 done
 
+# Move out processed options from arguments
+shift $(( OPTIND - 1 ))
+
 # Check for the command
 command=$1
 if [ -z $command ]; then
     usage
 fi
 
+# Move out command from arguments
+shift
+
 #
 # check if they specified both DIRS and RPMFILES
 #
 
-shift 1
 if [ ! -z "$RPMFILES" ]; then
     process $command
     if [ $# -gt 0 ]; then
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |