* Fixes for policycoreutils scripts
@ 2008-01-11 21:20 Daniel J Walsh
2008-01-23 21:02 ` Stephen Smalley
0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Walsh @ 2008-01-11 21:20 UTC (permalink / raw)
To: Stephen Smalley, SE Linux
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
-----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-----
[-- Attachment #2: policycoreutils-scripts.patch --]
[-- Type: text/plain, Size: 3072 bytes --]
--- nsapolicycoreutils/scripts/chcat 2007-08-23 16:52:26.000000000 -0400
+++ policycoreutils-2.0.35/scripts/chcat 2008-01-11 11:17:46.000000000 -0500
@@ -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')
--- nsapolicycoreutils/scripts/fixfiles 2007-12-10 21:42:28.000000000 -0500
+++ policycoreutils-2.0.35/scripts/fixfiles 2008-01-11 11:17:46.000000000 -0500
@@ -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 $?
--- nsapolicycoreutils/semanage/semanage 2007-10-05 13:09:53.000000000 -0400
+++ policycoreutils-2.0.35/semanage/semanage 2008-01-11 11:17:46.000000000 -0500
@@ -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,
[-- Attachment #3: policycoreutils-scripts.patch.sig --]
[-- Type: application/octet-stream, Size: 72 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fixes for policycoreutils scripts
2008-01-11 21:20 Fixes for policycoreutils scripts Daniel J Walsh
@ 2008-01-23 21:02 ` Stephen Smalley
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2008-01-23 21:02 UTC (permalink / raw)
To: Daniel J Walsh; +Cc: SE Linux
On Fri, 2008-01-11 at 16:20 -0500, Daniel J Walsh wrote:
> -----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
Merged.
--
Stephen Smalley
National Security Agency
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-23 21:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11 21:20 Fixes for policycoreutils scripts Daniel J Walsh
2008-01-23 21:02 ` Stephen Smalley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.