|
From: <ssm...@us...> - 2007-08-23 14:32:50
|
Revision: 2524
http://selinux.svn.sourceforge.net/selinux/?rev=2524&view=rev
Author: ssmalley
Date: 2007-08-23 07:32:48 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
Author: Daniel J Walsh
Email: dw...@re...
Subject: policycoreutils changes
Date: Tue, 21 Aug 2007 16:41:56 -0400
Change run_tty and open_init_pty to 755 instead of 555. Some audit
tools are reporting this as a problem. And I see no real value of 555.
for these to.
Simple bugfix for chcat
Fixes to make sure fixfiles reports errors and handles strange regexes.
Speed enhancement for genhomedircon to only compile regex's once.
Modified Paths:
--------------
trunk/policycoreutils/run_init/Makefile
trunk/policycoreutils/scripts/chcat
trunk/policycoreutils/scripts/fixfiles
trunk/policycoreutils/scripts/genhomedircon
trunk/policycoreutils/semanage/semanage
Modified: trunk/policycoreutils/run_init/Makefile
===================================================================
--- trunk/policycoreutils/run_init/Makefile 2007-08-23 14:19:41 UTC (rev 2523)
+++ trunk/policycoreutils/run_init/Makefile 2007-08-23 14:32:48 UTC (rev 2524)
@@ -34,8 +34,8 @@
install: all
test -d $(SBINDIR) || install -m 755 -d $(SBINDIR)
test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1
- install -m 555 run_init $(SBINDIR)
- install -m 555 open_init_pty $(SBINDIR)
+ install -m 755 run_init $(SBINDIR)
+ install -m 755 open_init_pty $(SBINDIR)
install -m 644 run_init.8 $(MANDIR)/man8/
install -m 644 open_init_pty.8 $(MANDIR)/man8/
ifeq (${PAMH}, /usr/include/security/pam_appl.h)
Modified: trunk/policycoreutils/scripts/chcat
===================================================================
--- trunk/policycoreutils/scripts/chcat 2007-08-23 14:19:41 UTC (rev 2523)
+++ trunk/policycoreutils/scripts/chcat 2007-08-23 14:32:48 UTC (rev 2524)
@@ -77,7 +77,7 @@
if len(cats) > 0:
new_serange = "%s-%s:%s" % (serange[0], top[0], ",".join(cats))
- else
+ else:
new_serange = "%s-%s" % (serange[0], top[0])
if add_ind:
@@ -155,7 +155,7 @@
if len(cats) > 0:
new_serange = "%s-%s:%s" % (serange[0], top[0], ",".join(cats))
- else
+ else:
new_serange = "%s-%s" % (serange[0], top[0])
if add_ind:
Modified: trunk/policycoreutils/scripts/fixfiles
===================================================================
--- trunk/policycoreutils/scripts/fixfiles 2007-08-23 14:19:41 UTC (rev 2523)
+++ trunk/policycoreutils/scripts/fixfiles 2007-08-23 14:32:48 UTC (rev 2524)
@@ -88,7 +88,7 @@
esac; \
fi; \
done | \
- while read pattern ; do find $pattern \
+ while read pattern ; do sh -c "find $pattern" \
! \( -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 | \
@@ -108,6 +108,7 @@
rpmlist() {
rpm -q --qf '[%{FILESTATES} %{FILENAMES}\n]' "$1" | grep '^0 ' | cut -f2- -d ' '
+[ ${PIPESTATUS[0]} != 0 ] && echo "$1 not found" >/dev/stderr
}
#
Modified: trunk/policycoreutils/scripts/genhomedircon
===================================================================
--- trunk/policycoreutils/scripts/genhomedircon 2007-08-23 14:19:41 UTC (rev 2523)
+++ trunk/policycoreutils/scripts/genhomedircon 2007-08-23 14:32:48 UTC (rev 2524)
@@ -139,7 +139,22 @@
self.default_user = "user_u"
self.default_prefix = "user"
self.users = self.getUsers()
+ fd = open(self.getFileContextFile())
+ self.fclines=[]
+ for i in fd.readlines():
+ try:
+ regex = i.split()[0]
+ #match a trailing .+
+ regex = re.sub("\.+$", "", regex)
+ regex = re.sub("\.\*$", "", regex)
+ regex = re.sub("\(\/\.\*\)\?", "", regex)
+ regex = regex + "/*$"
+ self.fclines.append(re.compile(regex))
+ except:
+ continue
+ fd.close()
+
def getFileContextDir(self):
return self.selinuxdir+self.type+self.filecontextdir
@@ -289,20 +304,9 @@
return ret+"\n"
def checkExists(self, home):
- fd = open(self.getFileContextFile())
- for i in fd.readlines():
- if len(i) == 0:
- continue
+ for i in self.fclines:
try:
- regex = i.split()[0]
- #match a trailing .+
- regex = re.sub("\.+$", "", regex)
- regex = re.sub("\.\*$", "", regex)
- #strip a (/.*)? which matches anything trailing to a /*$ which matches trailing /'s
-
- regex = re.sub("\(\/\.\*\)\?", "", regex)
- regex = regex + "/*$"
- if re.search(regex,home, 0):
+ if i.match(home):
return 1
except:
continue
Modified: trunk/policycoreutils/semanage/semanage
===================================================================
--- trunk/policycoreutils/semanage/semanage 2007-08-23 14:19:41 UTC (rev 2523)
+++ trunk/policycoreutils/semanage/semanage 2007-08-23 14:32:48 UTC (rev 2524)
@@ -34,7 +34,10 @@
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.__stdout__, 'replace')
try:
- gettext.install(PROGNAME, localedir="/usr/share/locale", unicode=1)
+ gettext.install(PROGNAME,
+ localedir="/usr/share/locale",
+ unicode=False,
+ codeset = 'utf-8')
except IOError:
import __builtin__
__builtin__.__dict__['_'] = unicode
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|