2007-06-22 13:33:42 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/audit2allow/Makefile policycoreutils-2.0.22/audit2allow/Makefile
|
2007-07-20 16:09:40 +00:00
|
|
|
--- nsapolicycoreutils/audit2allow/Makefile 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/audit2allow/Makefile 2007-07-23 10:40:06.000000000 -0400
|
2007-04-18 18:35:04 +00:00
|
|
|
@@ -1,6 +1,7 @@
|
2007-03-23 12:54:17 +00:00
|
|
|
# Installation directories.
|
|
|
|
PREFIX ?= ${DESTDIR}/usr
|
2007-04-18 18:35:04 +00:00
|
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
+SBINDIR ?= $(PREFIX)/sbin
|
2007-03-23 12:54:17 +00:00
|
|
|
LIBDIR ?= $(PREFIX)/lib
|
|
|
|
MANDIR ?= $(PREFIX)/share/man
|
|
|
|
LOCALEDIR ?= /usr/share/locale
|
2007-04-18 18:35:04 +00:00
|
|
|
@@ -10,7 +11,7 @@
|
|
|
|
install: all
|
|
|
|
-mkdir -p $(BINDIR)
|
|
|
|
install -m 755 audit2allow $(BINDIR)
|
|
|
|
- install -m 755 sepolgen-ifgen $(BINDIR)
|
|
|
|
+ install -m 755 sepolgen-ifgen $(SBINDIR)
|
|
|
|
-mkdir -p $(MANDIR)/man1
|
|
|
|
install -m 644 audit2allow.1 $(MANDIR)/man1/
|
|
|
|
|
2007-07-31 19:39:20 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/ChangeLog policycoreutils-2.0.22/ChangeLog
|
|
|
|
--- nsapolicycoreutils/ChangeLog 2007-07-16 14:20:43.000000000 -0400
|
|
|
|
+++ policycoreutils-2.0.22/ChangeLog 2007-06-21 05:17:13.000000000 -0400
|
|
|
|
@@ -91,7 +91,6 @@
|
|
|
|
1.33.15 2007-01-17
|
|
|
|
* Merged unicode-to-string fix for seobject audit from Dan Walsh.
|
|
|
|
* Merged man page updates to make "apropos selinux" work from Dan Walsh.
|
|
|
|
-
|
|
|
|
1.33.14 2007-01-16
|
|
|
|
* Merged newrole man page patch from Michael Thompson.
|
|
|
|
|
2007-06-22 13:33:42 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/Makefile policycoreutils-2.0.22/Makefile
|
2007-07-20 16:09:40 +00:00
|
|
|
--- nsapolicycoreutils/Makefile 2007-07-16 14:20:43.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/Makefile 2007-07-23 10:40:06.000000000 -0400
|
2006-11-14 16:03:27 +00:00
|
|
|
@@ -1,4 +1,4 @@
|
2007-05-18 14:44:34 +00:00
|
|
|
-SUBDIRS=setfiles semanage load_policy newrole run_init restorecond secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po
|
|
|
|
+SUBDIRS=setfiles semanage load_policy newrole run_init restorecond secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po gui
|
2006-11-14 16:03:27 +00:00
|
|
|
|
|
|
|
all install relabel clean indent:
|
|
|
|
@for subdir in $(SUBDIRS); do \
|
2007-07-20 16:09:40 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/restorecond/Makefile policycoreutils-2.0.22/restorecond/Makefile
|
|
|
|
--- nsapolicycoreutils/restorecond/Makefile 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/restorecond/Makefile 2007-07-23 10:40:06.000000000 -0400
|
2007-07-20 16:09:40 +00:00
|
|
|
@@ -22,7 +22,7 @@
|
|
|
|
-mkdir -p $(INITDIR)
|
|
|
|
install -m 644 restorecond.init $(INITDIR)/restorecond
|
|
|
|
-mkdir -p $(SELINUXDIR)
|
|
|
|
- install -m 600 restorecond.conf $(SELINUXDIR)/restorecond.conf
|
|
|
|
+ install -m 644 restorecond.conf $(SELINUXDIR)/restorecond.conf
|
|
|
|
|
|
|
|
relabel: install
|
|
|
|
/sbin/restorecon $(SBINDIR)/restorecond
|
2007-06-22 13:33:42 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/restorecond/restorecond.c policycoreutils-2.0.22/restorecond/restorecond.c
|
2007-07-20 16:09:40 +00:00
|
|
|
--- nsapolicycoreutils/restorecond/restorecond.c 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/restorecond/restorecond.c 2007-07-23 10:40:06.000000000 -0400
|
2006-11-29 17:48:22 +00:00
|
|
|
@@ -210,9 +210,10 @@
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fsetfilecon(fd, scontext) < 0) {
|
|
|
|
- syslog(LOG_ERR,
|
|
|
|
- "set context %s->%s failed:'%s'\n",
|
|
|
|
- filename, scontext, strerror(errno));
|
|
|
|
+ if (errno != EOPNOTSUPP)
|
|
|
|
+ syslog(LOG_ERR,
|
|
|
|
+ "set context %s->%s failed:'%s'\n",
|
|
|
|
+ filename, scontext, strerror(errno));
|
|
|
|
if (retcontext >= 0)
|
|
|
|
free(prev_context);
|
|
|
|
free(scontext);
|
|
|
|
@@ -225,8 +226,9 @@
|
|
|
|
if (retcontext >= 0)
|
|
|
|
free(prev_context);
|
|
|
|
} else {
|
|
|
|
- syslog(LOG_ERR, "get context on %s failed: '%s'\n",
|
|
|
|
- filename, strerror(errno));
|
|
|
|
+ if (errno != EOPNOTSUPP)
|
|
|
|
+ syslog(LOG_ERR, "get context on %s failed: '%s'\n",
|
|
|
|
+ filename, strerror(errno));
|
|
|
|
}
|
|
|
|
free(scontext);
|
|
|
|
close(fd);
|
2007-07-20 16:09:40 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/run_init/Makefile policycoreutils-2.0.22/run_init/Makefile
|
|
|
|
--- nsapolicycoreutils/run_init/Makefile 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/run_init/Makefile 2007-07-23 10:40:06.000000000 -0400
|
2007-07-20 16:09:40 +00:00
|
|
|
@@ -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)
|
2007-06-22 13:33:42 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/scripts/chcat policycoreutils-2.0.22/scripts/chcat
|
2007-07-20 16:09:40 +00:00
|
|
|
--- nsapolicycoreutils/scripts/chcat 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/scripts/chcat 2007-07-23 10:40:06.000000000 -0400
|
2007-06-22 13:33:42 +00:00
|
|
|
@@ -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:
|
2007-07-23 14:31:40 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-2.0.22/scripts/fixfiles
|
|
|
|
--- nsapolicycoreutils/scripts/fixfiles 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/scripts/fixfiles 2007-07-31 15:36:53.000000000 -0400
|
|
|
|
@@ -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 | \
|
2007-07-23 14:31:40 +00:00
|
|
|
@@ -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
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
2007-07-06 13:47:43 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-2.0.22/scripts/genhomedircon
|
2007-07-20 16:09:40 +00:00
|
|
|
--- nsapolicycoreutils/scripts/genhomedircon 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/scripts/genhomedircon 2007-07-23 10:40:06.000000000 -0400
|
2007-07-06 13:47:43 +00:00
|
|
|
@@ -302,7 +302,7 @@
|
|
|
|
|
|
|
|
regex = re.sub("\(\/\.\*\)\?", "", regex)
|
|
|
|
regex = regex + "/*$"
|
|
|
|
- if re.search(regex,home, 0):
|
|
|
|
+ if re.match(regex,home):
|
|
|
|
return 1
|
|
|
|
except:
|
|
|
|
continue
|
2007-06-22 13:33:42 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage policycoreutils-2.0.22/semanage/semanage
|
2007-07-20 16:09:40 +00:00
|
|
|
--- nsapolicycoreutils/semanage/semanage 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/semanage/semanage 2007-07-23 10:40:06.000000000 -0400
|
2007-06-11 16:47:29 +00:00
|
|
|
@@ -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
|
2007-06-22 13:33:42 +00:00
|
|
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-2.0.22/semanage/seobject.py
|
2007-07-20 16:09:40 +00:00
|
|
|
--- nsapolicycoreutils/semanage/seobject.py 2007-07-16 14:20:41.000000000 -0400
|
2007-07-31 19:39:20 +00:00
|
|
|
+++ policycoreutils-2.0.22/semanage/seobject.py 2007-07-31 09:55:36.000000000 -0400
|
2007-04-18 18:35:04 +00:00
|
|
|
@@ -210,6 +210,7 @@
|
2006-11-15 21:14:38 +00:00
|
|
|
os.write(fd, self.out())
|
|
|
|
os.close(fd)
|
|
|
|
os.rename(newfilename, self.filename)
|
|
|
|
+ os.system("/sbin/service mcstrans reload > /dev/null")
|
2007-02-22 15:14:00 +00:00
|
|
|
|
2006-11-15 21:14:38 +00:00
|
|
|
class semanageRecords:
|
|
|
|
def __init__(self):
|
2007-07-31 19:39:20 +00:00
|
|
|
@@ -1051,26 +1052,30 @@
|
|
|
|
raise ValueError(_("Could not create file context for %s") % target)
|
|
|
|
|
|
|
|
rc = semanage_fcontext_set_expr(self.sh, fcontext, target)
|
|
|
|
- (rc, con) = semanage_context_create(self.sh)
|
|
|
|
- if rc < 0:
|
|
|
|
- raise ValueError(_("Could not create context for %s") % target)
|
|
|
|
-
|
|
|
|
- rc = semanage_context_set_user(self.sh, con, seuser)
|
|
|
|
- if rc < 0:
|
|
|
|
- raise ValueError(_("Could not set user in file context for %s") % target)
|
|
|
|
-
|
|
|
|
- rc = semanage_context_set_role(self.sh, con, "object_r")
|
|
|
|
- if rc < 0:
|
|
|
|
- raise ValueError(_("Could not set role in file context for %s") % target)
|
|
|
|
-
|
|
|
|
- rc = semanage_context_set_type(self.sh, con, type)
|
|
|
|
- if rc < 0:
|
|
|
|
- raise ValueError(_("Could not set type in file context for %s") % target)
|
|
|
|
-
|
|
|
|
- if serange != "":
|
|
|
|
- rc = semanage_context_set_mls(self.sh, con, serange)
|
|
|
|
- if rc < 0:
|
|
|
|
- raise ValueError(_("Could not set mls fields in file context for %s") % target)
|
|
|
|
+ if type == "<<none>>":
|
|
|
|
+ rc, con = semanage_context_from_string(self.sh, type)
|
|
|
|
+ if rc < 0:
|
|
|
|
+ raise ValueError(_("Could not set context from string %s for %s") % (type, target))
|
|
|
|
+ else:
|
|
|
|
+ (rc, con) = semanage_context_create(self.sh)
|
|
|
|
+ if rc < 0:
|
|
|
|
+ raise ValueError(_("Could not create context for %s") % target)
|
|
|
|
+ rc = semanage_context_set_user(self.sh, con, seuser)
|
|
|
|
+ if rc < 0:
|
|
|
|
+ raise ValueError(_("Could not set user in file context for %s") % target)
|
|
|
|
+
|
|
|
|
+ rc = semanage_context_set_role(self.sh, con, "object_r")
|
|
|
|
+ if rc < 0:
|
|
|
|
+ raise ValueError(_("Could not set role in file context for %s") % target)
|
|
|
|
+
|
|
|
|
+ rc = semanage_context_set_type(self.sh, con, type)
|
|
|
|
+ if rc < 0:
|
|
|
|
+ raise ValueError(_("Could not set type in file context for %s") % target)
|
|
|
|
+
|
|
|
|
+ if serange != "":
|
|
|
|
+ rc = semanage_context_set_mls(self.sh, con, serange)
|
|
|
|
+ if rc < 0:
|
|
|
|
+ raise ValueError(_("Could not set mls fields in file context for %s") % target)
|
|
|
|
|
|
|
|
semanage_fcontext_set_type(fcontext, file_types[ftype])
|
|
|
|
|
|
|
|
@@ -1283,9 +1288,12 @@
|
2007-03-13 00:48:19 +00:00
|
|
|
raise ValueError(_("Could not list booleans"))
|
|
|
|
|
|
|
|
for boolean in self.blist:
|
|
|
|
- name = semanage_bool_get_name(boolean)
|
|
|
|
- value = semanage_bool_get_value(boolean)
|
|
|
|
- ddict[name] = value
|
|
|
|
+ value = []
|
|
|
|
+ name = semanage_bool_get_name(boolean)
|
|
|
|
+ value[0] = semanage_bool_get_value(boolean)
|
|
|
|
+ value[1] = selinux.security_get_boolean_pending(boolean)
|
|
|
|
+ value[2] = selinux.security_get_boolean_active(boolean)
|
|
|
|
+ ddict[name] = value
|
|
|
|
|
|
|
|
return ddict
|
|
|
|
|