|
From: <ssm...@us...> - 2008-01-23 14:19:51
|
Revision: 2736
http://selinux.svn.sourceforge.net/selinux/?rev=2736&view=rev
Author: ssmalley
Date: 2008-01-23 06:19:47 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
Author: Daniel J Walsh
Email: dw...@re...
Subject: Fixes for policycoreutils scripts
Date: Fri, 11 Jan 2008 16:20:14 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Remove python hack to handle lanquage translations on errors. Python
works properly now.
Fix fixfiles to handle multiple inputs on the command line correctly
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAkeH3Y0ACgkQrlYvE4MpobO5HwCg6xLhCuOPYY0NBIVa8XCa/rYN
+t8An3eqHjDNSsGhN9hAEoULsyiWkAqo
=Oasn
-----END PGP SIGNATURE-----
Modified Paths:
--------------
trunk/policycoreutils/scripts/chcat
trunk/policycoreutils/scripts/fixfiles
trunk/policycoreutils/semanage/semanage
Modified: trunk/policycoreutils/scripts/chcat
===================================================================
--- trunk/policycoreutils/scripts/chcat 2008-01-23 14:18:22 UTC (rev 2735)
+++ trunk/policycoreutils/scripts/chcat 2008-01-23 14:19:47 UTC (rev 2736)
@@ -25,10 +25,6 @@
import commands, sys, os, pwd, string, getopt, selinux
import seobject
import gettext
-import codecs
-import locale
-sys.stderr = codecs.getwriter(locale.getpreferredencoding())(sys.__stderr__, 'replace')
-sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.__stdout__, 'replace')
try:
gettext.install('policycoreutils')
Modified: trunk/policycoreutils/scripts/fixfiles
===================================================================
--- trunk/policycoreutils/scripts/fixfiles 2008-01-23 14:18:22 UTC (rev 2735)
+++ trunk/policycoreutils/scripts/fixfiles 2008-01-23 14:19:47 UTC (rev 2736)
@@ -126,17 +126,15 @@
done
exit $?
fi
-if [ ! -z "$DIRS" ]; then
+if [ ! -z "$FILEPATH" ]; then
if [ -x /usr/bin/find ]; then
- for d in ${DIRS} ; do find $d \
+ /usr/bin/find "$FILEPATH" \
! \( -fstype ext2 -o -fstype ext3 -o -fstype jfs -o -fstype xfs \) -prune -o -print | \
${RESTORECON} ${OUTFILES} ${FORCEFLAG} $* -f - 2>&1 >> $LOGFILE
- done
else
- ${RESTORECON} ${OUTFILES} ${FORCEFLAG} -R $* $DIRS 2>&1 >> $LOGFILE
+ ${RESTORECON} ${OUTFILES} ${FORCEFLAG} -R $* $FILEPATH 2>&1 >> $LOGFILE
fi
-
- exit $?
+ return
fi
LogReadOnly
${SETFILES} -q ${OUTFILES} ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 >> $LOGFILE
@@ -173,6 +171,20 @@
fi
}
+process() {
+#
+# Make sure they specified one of the three valid commands
+#
+case "$1" in
+ restore) restore -p ;;
+ check) restore -n -v;;
+ verify) restore -n -o -;;
+ relabel) relabel;;
+ *)
+ usage
+ exit 1
+esac
+}
usage() {
echo $"Usage: $0 [-l logfile ] [-o outputfile ] { check | restore|[-F] relabel } [[dir] ... ] "
echo or
@@ -229,22 +241,19 @@
shift 1
if [ ! -z "$RPMFILES" ]; then
+ process $command
if [ $# -gt 0 ]; then
usage
fi
else
- DIRS=$*
+ if [ -z "$1" ]; then
+ process $command
+ else
+ while [ -n "$1" ]; do
+ FILEPATH=$1
+ process $command
+ shift
+ done
+ fi
fi
-
-#
-# Make sure they specified one of the three valid commands
-#
-case "$command" in
- restore) restore -p ;;
- check) restore -n -v ;;
- verify) restore -n -o -;;
- relabel) relabel;;
- *)
- usage
- exit 1
-esac
+exit $?
Modified: trunk/policycoreutils/semanage/semanage
===================================================================
--- trunk/policycoreutils/semanage/semanage 2008-01-23 14:18:22 UTC (rev 2735)
+++ trunk/policycoreutils/semanage/semanage 2008-01-23 14:19:47 UTC (rev 2736)
@@ -1,5 +1,5 @@
#! /usr/bin/python -E
-# Copyright (C) 2005 Red Hat
+# Copyright (C) 2005, 2006, 2007 Red Hat
# see file 'COPYING' for use and warranty information
#
# semanage is a tool for managing SELinux configuration files
@@ -28,10 +28,6 @@
import gettext
gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
gettext.textdomain(PROGNAME)
-import codecs
-import locale
-sys.stderr = codecs.getwriter(locale.getpreferredencoding())(sys.__stderr__, 'replace')
-sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.__stdout__, 'replace')
try:
gettext.install(PROGNAME,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|