From 6545ae2adacc81153a621b582c7398f03aff1f46 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Apr 23 2018 12:31:24 +0000 Subject: SELinux userspace 2.8-rc1 release candidate --- diff --git a/.gitignore b/.gitignore index 43981e9..9a4e510 100644 --- a/.gitignore +++ b/.gitignore @@ -248,3 +248,10 @@ policycoreutils-2.0.83.tgz /selinux-dbus-2.7.tar.gz /semodule-utils-2.7.tar.gz /restorecond-2.7.tar.gz +/policycoreutils-2.8-rc1.tar.gz +/restorecond-2.8-rc1.tar.gz +/selinux-dbus-2.8-rc1.tar.gz +/selinux-gui-2.8-rc1.tar.gz +/selinux-python-2.8-rc1.tar.gz +/selinux-sandbox-2.8-rc1.tar.gz +/semodule-utils-2.8-rc1.tar.gz diff --git a/policycoreutils-fedora.patch b/policycoreutils-fedora.patch index 3ba77b5..2e3fb0f 100644 --- a/policycoreutils-fedora.patch +++ b/policycoreutils-fedora.patch @@ -1,277 +1,7 @@ -diff --git policycoreutils-2.7/hll/pp/Makefile policycoreutils-2.7/hll/pp/Makefile -index 3401dcc..fc8d3c4 100644 ---- policycoreutils-2.7/hll/pp/Makefile -+++ policycoreutils-2.7/hll/pp/Makefile -@@ -1,8 +1,5 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --INCLUDEDIR ?= $(PREFIX)/include --MANDIR = $(PREFIX)/share/man --LIBDIR ?= $(PREFIX)/lib -+PREFIX ?= /usr - LIBEXECDIR ?= $(PREFIX)/libexec - HLLDIR ?= $(LIBEXECDIR)/selinux/hll - -@@ -21,8 +18,8 @@ pp: $(PP_OBJS) - $(CC) $(CFLAGS) -c -o $@ $^ - - install: all -- -mkdir -p $(HLLDIR) -- install -m 755 pp $(HLLDIR) -+ -mkdir -p $(DESTDIR)$(HLLDIR) -+ install -m 755 pp $(DESTDIR)$(HLLDIR) - - relabel: - -diff --git policycoreutils-2.7/load_policy/Makefile policycoreutils-2.7/load_policy/Makefile -index b85833c..568d5d4 100644 ---- policycoreutils-2.7/load_policy/Makefile -+++ policycoreutils-2.7/load_policy/Makefile -@@ -1,8 +1,8 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --SBINDIR ?= $(DESTDIR)/sbin -+PREFIX ?= /usr -+SBINDIR ?= $(PREFIX)/sbin - MANDIR ?= $(PREFIX)/share/man --LOCALEDIR ?= /usr/share/locale -+LOCALEDIR ?= $(DESTDIR)$(PREFIX)/share/locale - - CFLAGS ?= -Werror -Wall -W - override CFLAGS += $(LDFLAGS) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" -@@ -13,10 +13,10 @@ TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c))) - all: $(TARGETS) - - install: all -- -mkdir -p $(SBINDIR) -- install -m 755 $(TARGETS) $(SBINDIR) -- test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8 -- install -m 644 load_policy.8 $(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 $(TARGETS) $(DESTDIR)$(SBINDIR) -+ test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 load_policy.8 $(DESTDIR)$(MANDIR)/man8/ - - clean: - -rm -f $(TARGETS) *.o -@@ -25,4 +25,4 @@ indent: - ../../scripts/Lindent $(wildcard *.[ch]) - - relabel: -- /sbin/restorecon $(SBINDIR)/load_policy -+ /sbin/restorecon $(DESTDIR)$(SBINDIR)/load_policy -diff --git policycoreutils-2.7/load_policy/load_policy.8 policycoreutils-2.7/load_policy/load_policy.8 -index 5f5550d..0810995 100644 ---- policycoreutils-2.7/load_policy/load_policy.8 -+++ policycoreutils-2.7/load_policy/load_policy.8 -@@ -39,4 +39,4 @@ Initial policy load failed and enforcing mode requested - .SH AUTHORS - .nf - This manual page was written by Dan Walsh . --The program was written by Stephen Smalley . -+The program was written by Stephen Smalley . -diff --git policycoreutils-2.7/man/Makefile policycoreutils-2.7/man/Makefile -index 0d91cd4..8af1520 100644 ---- policycoreutils-2.7/man/Makefile -+++ policycoreutils-2.7/man/Makefile -@@ -1,12 +1,13 @@ - # Installation directories. --MAN5DIR ?= $(DESTDIR)/usr/share/man/man5 -+PREFIX ?= /usr -+MAN5DIR ?= $(PREFIX)/share/man/man5 - - all: - - clean: - - install: all -- mkdir -p $(MAN5DIR) -- install -m 644 man5/*.5 $(MAN5DIR) -+ mkdir -p $(DESTDIR)$(MAN5DIR) -+ install -m 644 man5/*.5 $(DESTDIR)$(MAN5DIR) - - relabel: -diff --git policycoreutils-2.7/newrole/Makefile policycoreutils-2.7/newrole/Makefile -index 196af92..a1bfe1a 100644 ---- policycoreutils-2.7/newrole/Makefile -+++ policycoreutils-2.7/newrole/Makefile -@@ -1,9 +1,9 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin - MANDIR ?= $(PREFIX)/share/man --ETCDIR ?= $(DESTDIR)/etc --LOCALEDIR = /usr/share/locale -+ETCDIR ?= /etc -+LOCALEDIR = $(DESTDIR)$(PREFIX)/share/locale - PAMH ?= $(shell test -f /usr/include/security/pam_appl.h && echo y) - AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y) - # Enable capabilities to permit newrole to generate audit records. -@@ -61,17 +61,17 @@ newrole: newrole.o $(EXTRA_OBJS) - $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) - - install: all -- test -d $(BINDIR) || install -m 755 -d $(BINDIR) -- test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d -- test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1 -- install -m $(MODE) newrole $(BINDIR) -- install -m 644 newrole.1 $(MANDIR)/man1/ -+ test -d $(DESTDIR)$(BINDIR) || install -m 755 -d $(DESTDIR)$(BINDIR) -+ test -d $(DESTDIR)$(ETCDIR)/pam.d || install -m 755 -d $(DESTDIR)$(ETCDIR)/pam.d -+ test -d $(DESTDIR)$(MANDIR)/man1 || install -m 755 -d $(DESTDIR)$(MANDIR)/man1 -+ install -m $(MODE) newrole $(DESTDIR)$(BINDIR) -+ install -m 644 newrole.1 $(DESTDIR)$(MANDIR)/man1/ - ifeq ($(PAMH), y) -- test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d -+ test -d $(DESTDIR)$(ETCDIR)/pam.d || install -m 755 -d $(DESTDIR)$(ETCDIR)/pam.d - ifeq ($(LSPP_PRIV),y) -- install -m 644 newrole-lspp.pamd $(ETCDIR)/pam.d/newrole -+ install -m 644 newrole-lspp.pamd $(DESTDIR)$(ETCDIR)/pam.d/newrole - else -- install -m 644 newrole.pamd $(ETCDIR)/pam.d/newrole -+ install -m 644 newrole.pamd $(DESTDIR)$(ETCDIR)/pam.d/newrole - endif - endif - -@@ -82,4 +82,4 @@ indent: - ../../scripts/Lindent $(wildcard *.[ch]) - - relabel: install -- /sbin/restorecon $(BINDIR)/newrole -+ /sbin/restorecon $(DESTDIR)$(BINDIR)/newrole -diff --git policycoreutils-2.7/newrole/hashtab.c policycoreutils-2.7/newrole/hashtab.c -index 77ed143..24c65c4 100644 ---- policycoreutils-2.7/newrole/hashtab.c -+++ policycoreutils-2.7/newrole/hashtab.c -@@ -1,5 +1,5 @@ - --/* Author : Stephen Smalley, */ -+/* Author : Stephen Smalley, */ - - /* FLASK */ - -diff --git policycoreutils-2.7/newrole/hashtab.h policycoreutils-2.7/newrole/hashtab.h -index 9f737df..3790f0a 100644 ---- policycoreutils-2.7/newrole/hashtab.h -+++ policycoreutils-2.7/newrole/hashtab.h -@@ -1,5 +1,5 @@ - --/* Author : Stephen Smalley, */ -+/* Author : Stephen Smalley, */ - - /* FLASK */ - -diff --git policycoreutils-2.7/po/Makefile policycoreutils-2.7/po/Makefile -index 5814861..575e143 100644 ---- policycoreutils-2.7/po/Makefile -+++ policycoreutils-2.7/po/Makefile -@@ -2,6 +2,7 @@ - # Makefile for the PO files (translation) catalog - # - -+PREFIX ?= /usr - TOP = ../.. - - # What is this package? -@@ -12,7 +13,7 @@ INSTALL_DATA = $(INSTALL) -m 644 - INSTALL_DIR = /usr/bin/install -d - - # destination directory --INSTALL_NLS_DIR = $(DESTDIR)/usr/share/locale -+INSTALL_NLS_DIR = $(PREFIX)/share/locale - - # PO catalog handling - MSGMERGE = msgmerge -@@ -128,8 +129,8 @@ clean: - install: $(MOFILES) - @for n in $(MOFILES); do \ - l=`basename $$n .mo`; \ -- $(INSTALL_DIR) $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \ -- $(INSTALL_DATA) --verbose $$n $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \ -+ $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \ -+ $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \ - done - - %.mo: %.po -diff --git policycoreutils-2.7/run_init/Makefile policycoreutils-2.7/run_init/Makefile -index 921f0b0..1d5de57 100644 ---- policycoreutils-2.7/run_init/Makefile -+++ policycoreutils-2.7/run_init/Makefile -@@ -1,10 +1,10 @@ - - # Installation directories. --PREFIX ?= $(DESTDIR)/usr -+PREFIX ?= /usr - SBINDIR ?= $(PREFIX)/sbin - MANDIR ?= $(PREFIX)/share/man --ETCDIR ?= $(DESTDIR)/etc --LOCALEDIR ?= /usr/share/locale -+ETCDIR ?= /etc -+LOCALEDIR ?= $(DESTDIR)$(PREFIX)/share/locale - PAMH ?= $(shell test -f /usr/include/security/pam_appl.h && echo y) - AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y) - -@@ -32,14 +32,14 @@ open_init_pty: open_init_pty.c - - - install: all -- test -d $(SBINDIR) || install -m 755 -d $(SBINDIR) -- test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8 -- 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/ -+ test -d $(DESTDIR)$(SBINDIR) || install -m 755 -d $(DESTDIR)$(SBINDIR) -+ test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8 -+ install -m 755 run_init $(DESTDIR)$(SBINDIR) -+ install -m 755 open_init_pty $(DESTDIR)$(SBINDIR) -+ install -m 644 run_init.8 $(DESTDIR)$(MANDIR)/man8/ -+ install -m 644 open_init_pty.8 $(DESTDIR)$(MANDIR)/man8/ - ifeq ($(PAMH), y) -- install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init -+ install -m 644 run_init.pamd $(DESTDIR)$(ETCDIR)/pam.d/run_init - endif - - clean: -@@ -49,4 +49,4 @@ indent: - ../../scripts/Lindent $(wildcard *.[ch]) - - relabel: install -- /sbin/restorecon $(SBINDIR)/run_init $(SBINDIR)/open_init_pty -+ /sbin/restorecon $(DESTDIR)$(SBINDIR)/run_init $(DESTDIR)$(SBINDIR)/open_init_pty -diff --git policycoreutils-2.7/scripts/Makefile policycoreutils-2.7/scripts/Makefile -index d9e86ff..afe5dc4 100644 ---- policycoreutils-2.7/scripts/Makefile -+++ policycoreutils-2.7/scripts/Makefile -@@ -1,17 +1,16 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --SBINDIR ?= $(DESTDIR)/sbin -+PREFIX ?= /usr -+SBINDIR ?= $(PREFIX)/sbin - MANDIR ?= $(PREFIX)/share/man --LOCALEDIR ?= $(PREFIX)/share/locale - - .PHONY: all - all: fixfiles - - install: all -- -mkdir -p $(SBINDIR) -- install -m 755 fixfiles $(SBINDIR) -- -mkdir -p $(MANDIR)/man8 -- install -m 644 fixfiles.8 $(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 fixfiles $(DESTDIR)$(SBINDIR) -+ -mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 fixfiles.8 $(DESTDIR)$(MANDIR)/man8/ - - clean: - -diff --git policycoreutils-2.7/scripts/fixfiles policycoreutils-2.7/scripts/fixfiles +diff --git policycoreutils-2.8-rc1/scripts/fixfiles policycoreutils-2.8-rc1/scripts/fixfiles index 1aa330f..7ec0396 100755 ---- policycoreutils-2.7/scripts/fixfiles -+++ policycoreutils-2.7/scripts/fixfiles +--- policycoreutils-2.8-rc1/scripts/fixfiles ++++ policycoreutils-2.8-rc1/scripts/fixfiles @@ -108,6 +108,7 @@ exclude_dirs_from_relabelling() { fullFlag=0 BOOTTIME="" @@ -280,202 +10,3 @@ index 1aa330f..7ec0396 100755 FORCEFLAG="" RPMFILES="" PREFC="" -diff --git policycoreutils-2.7/secon/Makefile policycoreutils-2.7/secon/Makefile -index 8e491d7..db8ee42 100644 ---- policycoreutils-2.7/secon/Makefile -+++ policycoreutils-2.7/secon/Makefile -@@ -1,9 +1,7 @@ - # secon tool - command-line context --PREFIX ?= $(DESTDIR)/usr --INCLUDEDIR ?= $(PREFIX)/include -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin - MANDIR ?= $(PREFIX)/share/man --LIBDIR ?= $(PREFIX)/lib - - WARNS=-Werror -W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal - VERSION = $(shell cat ../VERSION) -@@ -18,13 +16,13 @@ secon: secon.o - install-nogui: install - - install: all -- install -m 755 secon $(BINDIR); -+ install -m 755 secon $(DESTDIR)$(BINDIR); - -- test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1 -- install -m 644 secon.1 $(MANDIR)/man1 -+ test -d $(DESTDIR)$(MANDIR)/man1 || install -m 755 -d $(DESTDIR)$(MANDIR)/man1 -+ install -m 644 secon.1 $(DESTDIR)$(MANDIR)/man1 - - relabel: -- /sbin/restorecon $(BINDIR)/secon -+ /sbin/restorecon $(DESTDIR)$(BINDIR)/secon - - clean: - rm -f *.o core* secon *~ *.bak -diff --git policycoreutils-2.7/semodule/Makefile policycoreutils-2.7/semodule/Makefile -index fffb43a..639d368 100644 ---- policycoreutils-2.7/semodule/Makefile -+++ policycoreutils-2.7/semodule/Makefile -@@ -1,9 +1,7 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --INCLUDEDIR ?= $(PREFIX)/include -+PREFIX ?= /usr - SBINDIR ?= $(PREFIX)/sbin - MANDIR = $(PREFIX)/share/man --LIBDIR ?= $(PREFIX)/lib - - CFLAGS ?= -Werror -Wall -W - override LDLIBS += -lsepol -lselinux -lsemanage -@@ -17,12 +15,12 @@ genhomedircon: - ln -sf semodule genhomedircon - - install: all -- -mkdir -p $(SBINDIR) -- install -m 755 semodule $(SBINDIR) -- (cd $(SBINDIR); ln -sf semodule genhomedircon) -- test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8 -- install -m 644 semodule.8 $(MANDIR)/man8/ -- install -m 644 genhomedircon.8 $(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 semodule $(DESTDIR)$(SBINDIR) -+ (cd $(DESTDIR)$(SBINDIR); ln -sf semodule genhomedircon) -+ test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 semodule.8 $(DESTDIR)$(MANDIR)/man8/ -+ install -m 644 genhomedircon.8 $(DESTDIR)$(MANDIR)/man8/ - - relabel: - -diff --git policycoreutils-2.7/sestatus/Makefile policycoreutils-2.7/sestatus/Makefile -index 41ca683..274ef35 100644 ---- policycoreutils-2.7/sestatus/Makefile -+++ policycoreutils-2.7/sestatus/Makefile -@@ -1,9 +1,8 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr -+PREFIX ?= /usr - SBINDIR ?= $(PREFIX)/sbin - MANDIR = $(PREFIX)/share/man --ETCDIR ?= $(DESTDIR)/etc --LIBDIR ?= $(PREFIX)/lib -+ETCDIR ?= /etc - - CFLAGS ?= -Werror -Wall -W - override CFLAGS += -D_FILE_OFFSET_BITS=64 -@@ -14,14 +13,14 @@ all: sestatus - sestatus: sestatus.o - - install: all -- [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8 -- [ -d $(MANDIR)/man5 ] || mkdir -p $(MANDIR)/man5 -- -mkdir -p $(SBINDIR) -- install -m 755 sestatus $(SBINDIR) -- install -m 644 sestatus.8 $(MANDIR)/man8 -- install -m 644 sestatus.conf.5 $(MANDIR)/man5 -- -mkdir -p $(ETCDIR) -- install -m 644 sestatus.conf $(ETCDIR) -+ [ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ [ -d $(DESTDIR)$(MANDIR)/man5 ] || mkdir -p $(DESTDIR)$(MANDIR)/man5 -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 sestatus $(DESTDIR)$(SBINDIR) -+ install -m 644 sestatus.8 $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 sestatus.conf.5 $(DESTDIR)$(MANDIR)/man5 -+ -mkdir -p $(DESTDIR)$(ETCDIR) -+ install -m 644 sestatus.conf $(DESTDIR)$(ETCDIR) - - clean: - rm -f sestatus *.o -diff --git policycoreutils-2.7/setfiles/Makefile policycoreutils-2.7/setfiles/Makefile -index c08e2dd..e943276 100644 ---- policycoreutils-2.7/setfiles/Makefile -+++ policycoreutils-2.7/setfiles/Makefile -@@ -1,8 +1,7 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --SBINDIR ?= $(DESTDIR)/sbin -+PREFIX ?= /usr -+SBINDIR ?= /sbin - MANDIR = $(PREFIX)/share/man --LIBDIR ?= $(PREFIX)/lib - AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y) - - ABORT_ON_ERRORS=$(shell grep "^\#define ABORT_ON_ERRORS" setfiles.c | awk -S '{ print $$3 }') -@@ -29,14 +28,14 @@ man: - @sed -i "s/ABORT_ON_ERRORS/$(ABORT_ON_ERRORS)/g" setfiles.8.man - - install: all -- [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8 -- -mkdir -p $(SBINDIR) -- install -m 755 setfiles $(SBINDIR) -- (cd $(SBINDIR) && ln -sf setfiles restorecon) -- install -m 755 restorecon_xattr $(SBINDIR) -- install -m 644 setfiles.8.man $(MANDIR)/man8/setfiles.8 -- install -m 644 restorecon.8 $(MANDIR)/man8/restorecon.8 -- install -m 644 restorecon_xattr.8 $(MANDIR)/man8/restorecon_xattr.8 -+ [ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 setfiles $(DESTDIR)$(SBINDIR) -+ (cd $(DESTDIR)$(SBINDIR) && ln -sf setfiles restorecon) -+ install -m 755 restorecon_xattr $(DESTDIR)$(SBINDIR) -+ install -m 644 setfiles.8.man $(DESTDIR)$(MANDIR)/man8/setfiles.8 -+ install -m 644 restorecon.8 $(DESTDIR)$(MANDIR)/man8/restorecon.8 -+ install -m 644 restorecon_xattr.8 $(DESTDIR)$(MANDIR)/man8/restorecon_xattr.8 - - clean: - rm -f setfiles restorecon restorecon_xattr *.o setfiles.8.man -@@ -45,4 +44,4 @@ indent: - ../../scripts/Lindent $(wildcard *.[ch]) - - relabel: install -- $(SBINDIR)/restorecon $(SBINDIR)/setfiles $(SBINDIR)/restorecon_xattr -+ $(DESTDIR)$(SBINDIR)/restorecon $(DESTDIR)$(SBINDIR)/setfiles $(DESTDIR)$(SBINDIR)/restorecon_xattr -diff --git policycoreutils-2.7/setfiles/setfiles.8 policycoreutils-2.7/setfiles/setfiles.8 -index 9501845..ccaaf4d 100644 ---- policycoreutils-2.7/setfiles/setfiles.8 -+++ policycoreutils-2.7/setfiles/setfiles.8 -@@ -255,7 +255,7 @@ being updated provided there are no errors. - - .SH "AUTHOR" - This man page was written by Russell Coker . --The program was written by Stephen Smalley -+The program was written by Stephen Smalley - - .SH "SEE ALSO" - .BR restorecon (8), -diff --git policycoreutils-2.7/setsebool/Makefile policycoreutils-2.7/setsebool/Makefile -index bc254da..47bea60 100644 ---- policycoreutils-2.7/setsebool/Makefile -+++ policycoreutils-2.7/setsebool/Makefile -@@ -1,10 +1,8 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --INCLUDEDIR ?= $(PREFIX)/include -+PREFIX ?= /usr - SBINDIR ?= $(PREFIX)/sbin - MANDIR = $(PREFIX)/share/man --LIBDIR ?= $(PREFIX)/lib --BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions -+BASHCOMPLETIONDIR ?= $(PREFIX)/share/bash-completion/completions - - CFLAGS ?= -Werror -Wall -W - override LDLIBS += -lsepol -lselinux -lsemanage -@@ -17,12 +15,12 @@ all: setsebool - setsebool: $(SETSEBOOL_OBJS) - - install: all -- -mkdir -p $(SBINDIR) -- install -m 755 setsebool $(SBINDIR) -- -mkdir -p $(MANDIR)/man8 -- install -m 644 setsebool.8 $(MANDIR)/man8/ -- -mkdir -p $(BASHCOMPLETIONDIR) -- install -m 644 $(BASHCOMPLETIONS) $(BASHCOMPLETIONDIR)/setsebool -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 setsebool $(DESTDIR)$(SBINDIR) -+ -mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 setsebool.8 $(DESTDIR)$(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(BASHCOMPLETIONDIR) -+ install -m 644 $(BASHCOMPLETIONS) $(DESTDIR)$(BASHCOMPLETIONDIR)/setsebool - - relabel: - diff --git a/policycoreutils.spec b/policycoreutils.spec index 5bad8cb..3f96494 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -1,24 +1,26 @@ %global libauditver 2.1.3-4 -%global libsepolver 2.7-6 -%global libsemanagever 2.7-12 -%global libselinuxver 2.7-13 -%global sepolgenver 2.7 +%global libsepolver 2.8-0 +%global libsemanagever 2.8-0 +%global libselinuxver 2.8-0 +%global sepolgenver 2.8 %global generatorsdir %{_prefix}/lib/systemd/system-generators +%global rcversion rc1 + Summary: SELinux policy core utilities Name: policycoreutils -Version: 2.7 -Release: 20%{?dist} +Version: 2.8 +Release: 0%{?rcversion:.%rcversion}.1%{?dist} License: GPLv2 # https://github.com/SELinuxProject/selinux/wiki/Releases -Source0: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/policycoreutils-2.7.tar.gz -Source1: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/selinux-python-2.7.tar.gz -Source2: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/selinux-gui-2.7.tar.gz -Source3: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/selinux-sandbox-2.7.tar.gz -Source4: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/selinux-dbus-2.7.tar.gz -Source5: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/semodule-utils-2.7.tar.gz -Source6: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/restorecond-2.7.tar.gz +Source0: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/policycoreutils-2.8-rc1.tar.gz +Source1: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/selinux-python-2.8-rc1.tar.gz +Source2: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/selinux-gui-2.8-rc1.tar.gz +Source3: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/selinux-sandbox-2.8-rc1.tar.gz +Source4: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/selinux-dbus-2.8-rc1.tar.gz +Source5: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/semodule-utils-2.8-rc1.tar.gz +Source6: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/restorecond-2.8-rc1.tar.gz URL: https://github.com/SELinuxProject Source12: policycoreutils_man_ru2.tar.bz2 Source13: system-config-selinux.png @@ -30,9 +32,9 @@ Source18: selinux-autorelabel.target Source19: selinux-autorelabel-generator.sh # download https://raw.githubusercontent.com/fedora-selinux/scripts/master/selinux/make-fedora-selinux-patch.sh # run: -# HEAD https://github.com/fedora-selinux/selinux/commit/63b18604d4bf020ca5cd7781ecf8c0e0443e02d1 +# HEAD https://github.com/fedora-selinux/selinux/commit/5127dfaae645986169b50a7295d4961a4959006a # $ for i in policycoreutils selinux-python selinux-gui selinux-sandbox selinux-dbus semodule-utils restorecond; do -# ./make-fedora-selinux-patch.sh $i +# VERSION=2.8-rc1 ./make-fedora-selinux-patch.sh $i # done Patch: policycoreutils-fedora.patch Patch1: selinux-python-fedora.patch @@ -83,25 +85,25 @@ to switch roles. %setup -q -T -D -a 6 -n selinux %patch -p0 -b .policycoreutils-fedora -cp %{SOURCE13} selinux-gui-%{version}/ -tar -xvf %{SOURCE14} -C selinux-python-%{version}/sepolicy/ +cp %{SOURCE13} selinux-gui-%{version}%{?rcversion:-%rcversion}/ +tar -xvf %{SOURCE14} -C selinux-python-%{version}%{?rcversion:-%rcversion}/sepolicy/ %patch1 -p0 -b .selinux-python -%patch2 -p0 -b .selinux-gui +#%patch2 -p0 -b .selinux-gui %patch3 -p0 -b .selinux-sandbox %patch4 -p0 -b .selinux-dbus -%patch5 -p0 -b .semodule-utils -%patch6 -p0 -b .restorecond +#%%patch5 -p0 -b .semodule-utils +#%%patch6 -p0 -b .restorecond %build %set_build_flags -make -C policycoreutils-%{version} LSPP_PRIV=y SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" SEMODULE_PATH="/usr/sbin" LIBSEPOLA="%{_libdir}/libsepol.a" all -make -C selinux-python-%{version} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all -make -C selinux-gui-%{version} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all -make -C selinux-sandbox-%{version} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all -make -C selinux-dbus-%{version} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all -make -C semodule-utils-%{version} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all -make -C restorecond-%{version} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all +make -C policycoreutils-%{version}%{?rcversion:-%rcversion} LSPP_PRIV=y SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" SEMODULE_PATH="/usr/sbin" LIBSEPOLA="%{_libdir}/libsepol.a" all +make -C selinux-python-%{version}%{?rcversion:-%rcversion} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all +make -C selinux-gui-%{version}%{?rcversion:-%rcversion} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all +make -C selinux-sandbox-%{version}%{?rcversion:-%rcversion} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all +make -C selinux-dbus-%{version}%{?rcversion:-%rcversion} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all +make -C semodule-utils-%{version}%{?rcversion:-%rcversion} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all +make -C restorecond-%{version}%{?rcversion:-%rcversion} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" all %install mkdir -p %{buildroot}%{_bindir} @@ -111,20 +113,20 @@ mkdir -p %{buildroot}%{_mandir}/man5 mkdir -p %{buildroot}%{_mandir}/man8 %{__mkdir} -p %{buildroot}/%{_usr}/share/doc/%{name}/ -make -C policycoreutils-%{version} LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" SEMODULE_PATH="/usr/sbin" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C policycoreutils-%{version}%{?rcversion:-%rcversion} LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" SEMODULE_PATH="/usr/sbin" LIBSEPOLA="%{_libdir}/libsepol.a" install -make -C selinux-python-%{version} PYTHON=%{__python2} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install -make -C selinux-python-%{version} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C selinux-python-%{version}%{?rcversion:-%rcversion} PYTHON=%{__python2} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C selinux-python-%{version}%{?rcversion:-%rcversion} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install -make -C selinux-gui-%{version} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C selinux-gui-%{version}%{?rcversion:-%rcversion} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install -make -C selinux-sandbox-%{version} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C selinux-sandbox-%{version}%{?rcversion:-%rcversion} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install -make -C selinux-dbus-%{version} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C selinux-dbus-%{version}%{?rcversion:-%rcversion} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install -make -C semodule-utils-%{version} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C semodule-utils-%{version}%{?rcversion:-%rcversion} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install -make -C restorecond-%{version} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install +make -C restorecond-%{version}%{?rcversion:-%rcversion} PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" install # Systemd @@ -468,7 +470,7 @@ system-config-selinux is a utility for managing the SELinux environment %{_mandir}/man8/semodule_package.8* %{_mandir}/ru/man8/semodule_package.8* %{!?_licensedir:%global license %%doc} -%license policycoreutils-%{version}/COPYING +%license policycoreutils-%{version}%{?rcversion:-%rcversion}/COPYING %doc %{_usr}/share/doc/%{name} %package restorecond @@ -488,7 +490,7 @@ The policycoreutils-restorecond package contains the restorecond service. %{_mandir}/man8/restorecond.8* %{_mandir}/ru/man8/restorecond.8* %{!?_licensedir:%global license %%doc} -%license policycoreutils-%{version}/COPYING +%license policycoreutils-%{version}%{?rcversion:-%rcversion}/COPYING %post restorecond %systemd_post restorecond.service @@ -500,6 +502,9 @@ The policycoreutils-restorecond package contains the restorecond service. %systemd_postun_with_restart restorecond.service %changelog +* Mon Apr 23 2018 Petr Lautrbach - 2.8-0.rc1.1 +- SELinux userspace 2.8-rc1 release candidate + * Thu Apr 19 2018 Petr Lautrbach - 2.7-20 - Drop python2 sepolicy gui files from policycoreutils-gui (#1566618) diff --git a/restorecond-fedora.patch b/restorecond-fedora.patch index 09b008c..e69de29 100644 --- a/restorecond-fedora.patch +++ b/restorecond-fedora.patch @@ -1,86 +0,0 @@ -diff --git restorecond-2.7/Makefile restorecond-2.7/Makefile -index ada94ae..25be18d 100644 ---- restorecond-2.7/Makefile -+++ restorecond-2.7/Makefile -@@ -1,13 +1,12 @@ - PKG_CONFIG ?= pkg-config - - # Installation directories. --PREFIX ?= $(DESTDIR)/usr -+PREFIX ?= /usr - SBINDIR ?= $(PREFIX)/sbin --LIBDIR ?= $(PREFIX)/lib - MANDIR = $(PREFIX)/share/man --AUTOSTARTDIR = $(DESTDIR)/etc/xdg/autostart --DBUSSERVICEDIR = $(DESTDIR)/usr/share/dbus-1/services --SYSTEMDDIR ?= $(DESTDIR)/usr/lib/systemd -+AUTOSTARTDIR = /etc/xdg/autostart -+DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services -+SYSTEMDDIR ?= $(PREFIX)/lib/systemd - - autostart_DATA = sealertauto.desktop - INITDIR ?= $(DESTDIR)/etc/rc.d/init.d -@@ -39,23 +38,23 @@ restorecond: restore.o restorecond.o utmpwatcher.o stringslist.o user.o watch.o - $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) - - install: all -- [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8 -- -mkdir -p $(SBINDIR) -- install -m 755 restorecond $(SBINDIR) -- install -m 644 restorecond.8 $(MANDIR)/man8 -+ [ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 restorecond $(DESTDIR)$(SBINDIR) -+ install -m 644 restorecond.8 $(DESTDIR)$(MANDIR)/man8 - -mkdir -p $(INITDIR) - install -m 755 restorecond.init $(INITDIR)/restorecond - -mkdir -p $(SELINUXDIR) - install -m 644 restorecond.conf $(SELINUXDIR)/restorecond.conf - install -m 644 restorecond_user.conf $(SELINUXDIR)/restorecond_user.conf -- -mkdir -p $(AUTOSTARTDIR) -- install -m 644 restorecond.desktop $(AUTOSTARTDIR)/restorecond.desktop -- -mkdir -p $(DBUSSERVICEDIR) -- install -m 600 org.selinux.Restorecond.service $(DBUSSERVICEDIR)/org.selinux.Restorecond.service -- -mkdir -p $(SYSTEMDDIR)/system -- install -m 644 restorecond.service $(SYSTEMDDIR)/system/ -+ -mkdir -p $(DESTDIR)$(AUTOSTARTDIR) -+ install -m 644 restorecond.desktop $(DESTDIR)$(AUTOSTARTDIR)/restorecond.desktop -+ -mkdir -p $(DESTDIR)$(DBUSSERVICEDIR) -+ install -m 600 org.selinux.Restorecond.service $(DESTDIR)$(DBUSSERVICEDIR)/org.selinux.Restorecond.service -+ -mkdir -p $(DESTDIR)$(SYSTEMDDIR)/system -+ install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDDIR)/system/ - relabel: install -- /sbin/restorecon $(SBINDIR)/restorecond -+ /sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond - - clean: - -rm -f restorecond *.o *~ -diff --git restorecond-2.7/restorecond.c restorecond-2.7/restorecond.c -index f379db1..6fbbd35 100644 ---- restorecond-2.7/restorecond.c -+++ restorecond-2.7/restorecond.c -@@ -103,7 +103,10 @@ static int write_pid_file(void) - pidfile = 0; - return 1; - } -- (void)write(pidfd, val, (unsigned int)len); -+ if (write(pidfd, val, (unsigned int)len) != len) { -+ syslog(LOG_ERR, "Unable to write to pidfile (%s)", strerror(errno)); -+ return 1; -+ } - close(pidfd); - return 0; - } -@@ -204,8 +207,10 @@ int main(int argc, char **argv) - watch_file = server_watch_file; - read_config(master_fd, watch_file); - -- if (!debug_mode) -- daemon(0, 0); -+ if (!debug_mode) { -+ if (daemon(0, 0) < 0) -+ exitApp("daemon"); -+ } - - write_pid_file(); - diff --git a/selinux-dbus-fedora.patch b/selinux-dbus-fedora.patch index a4982c4..2b3d509 100644 --- a/selinux-dbus-fedora.patch +++ b/selinux-dbus-fedora.patch @@ -1,36 +1,7 @@ -diff --git selinux-dbus-2.7/Makefile selinux-dbus-2.7/Makefile -index 9a6cc90..53143af 100644 ---- selinux-dbus-2.7/Makefile -+++ selinux-dbus-2.7/Makefile -@@ -1,3 +1,5 @@ -+PREFIX ?= /usr -+ - all: - - clean: -@@ -5,12 +7,12 @@ clean: - install: - -mkdir -p $(DESTDIR)/etc/dbus-1/system.d/ - install -m 644 org.selinux.conf $(DESTDIR)/etc/dbus-1/system.d/ -- -mkdir -p $(DESTDIR)/usr/share/dbus-1/system-services -- install -m 644 org.selinux.service $(DESTDIR)/usr/share/dbus-1/system-services -- -mkdir -p $(DESTDIR)/usr/share/polkit-1/actions/ -- install -m 644 org.selinux.policy $(DESTDIR)/usr/share/polkit-1/actions/ -- -mkdir -p $(DESTDIR)/usr/share/system-config-selinux -- install -m 755 selinux_server.py $(DESTDIR)/usr/share/system-config-selinux -+ -mkdir -p $(DESTDIR)$(PREFIX)/share/dbus-1/system-services -+ install -m 644 org.selinux.service $(DESTDIR)$(PREFIX)/share/dbus-1/system-services -+ -mkdir -p $(DESTDIR)$(PREFIX)/share/polkit-1/actions/ -+ install -m 644 org.selinux.policy $(DESTDIR)$(PREFIX)/share/polkit-1/actions/ -+ -mkdir -p $(DESTDIR)$(PREFIX)/share/system-config-selinux -+ install -m 755 selinux_server.py $(DESTDIR)$(PREFIX)/share/system-config-selinux - - relabel: - -diff --git selinux-dbus-2.7/org.selinux.conf selinux-dbus-2.7/org.selinux.conf +diff --git selinux-dbus-2.8-rc1/org.selinux.conf selinux-dbus-2.8-rc1/org.selinux.conf index a350978..1ae079d 100644 ---- selinux-dbus-2.7/org.selinux.conf -+++ selinux-dbus-2.7/org.selinux.conf +--- selinux-dbus-2.8-rc1/org.selinux.conf ++++ selinux-dbus-2.8-rc1/org.selinux.conf @@ -12,12 +12,8 @@ -+ -+ -+ False -+ 5 -+ normal -+ Red Hat 2007 -+ www.redhat.com -+ GPL -+ Daniel Walsh <dwalsh@redhat.com> -+ translator-credits -+ -+ -+ False -+ -+ -+ False -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ -+ -+ False -+ 12 -+ Add Booleans Dialog -+ mouse -+ 400 -+ dialog -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ end -+ -+ -+ gtk-cancel -+ True -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ gtk-add -+ True -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 2 -+ 2 -+ 12 -+ 6 -+ -+ -+ True -+ False -+ 0 -+ Boolean Name -+ -+ -+ GTK_FILL -+ -+ -+ -+ -+ -+ True -+ False -+ 0 -+ Description -+ -+ -+ 1 -+ 2 -+ GTK_FILL -+ -+ -+ -+ -+ -+ True -+ True -+ -+ False -+ False -+ True -+ True -+ -+ -+ 1 -+ 2 -+ -+ -+ -+ -+ -+ True -+ True -+ -+ False -+ False -+ True -+ True -+ -+ -+ 1 -+ 2 -+ 1 -+ 2 -+ -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ cancelbutton1 -+ okbutton1 -+ -+ -+ -+ False -+ 5 -+ mouse -+ dialog -+ True -+ True -+ -+ -+ True -+ False -+ 24 -+ -+ -+ True -+ False -+ end -+ -+ -+ gtk-cancel -+ True -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ gtk-add -+ True -+ True -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ -+ button5 -+ button6 -+ -+ -+ -+ True -+ False -+ SELinux Policy Generation Tool -+ -+ -+ True -+ False -+ 18 -+ -+ -+ True -+ False -+ left -+ False -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select the policy type for the application or user role you want to confine:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 12 -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 0 -+ <b>Applications</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ Standard Init Daemon -+ True -+ True -+ False -+ Standard Init Daemon are daemons started on boot via init scripts. Usually requires a script in /etc/rc.d/init.d -+ True -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ DBUS System Daemon -+ True -+ True -+ False -+ Standard Init Daemon are daemons started on boot via init scripts. Usually requires a script in /etc/rc.d/init.d -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ Internet Services Daemon (inetd) -+ True -+ True -+ False -+ Internet Services Daemon are daemons started by xinetd -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 2 -+ -+ -+ -+ -+ Web Application/Script (CGI) -+ True -+ True -+ False -+ Web Applications/Script (CGI) CGI scripts started by the web server (apache) -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 3 -+ -+ -+ -+ -+ User Application -+ True -+ True -+ False -+ User Application are any application that you would like to confine that is started by a user -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 4 -+ -+ -+ -+ -+ Sandbox -+ True -+ True -+ False -+ User Application are any application that you would like to confine that is started by a user -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 5 -+ -+ -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 0 -+ <b>Login Users</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ Existing User Roles -+ True -+ True -+ False -+ Modify an existing login user record. -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ Minimal Terminal User Role -+ True -+ True -+ False -+ This user will login to a machine only via a terminal or remote login. By default this user will have no setuid, no networking, no su, no sudo. -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ Minimal X Windows User Role -+ True -+ True -+ False -+ This user can login to a machine via X or terminal. By default this user will have no setuid, no networking, no sudo, no su -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 2 -+ -+ -+ -+ -+ User Role -+ True -+ True -+ False -+ User with full networking, no setuid applications without transition, no sudo, no su. -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 3 -+ -+ -+ -+ -+ Admin User Role -+ True -+ True -+ False -+ User with full networking, no setuid applications without transition, no su, can sudo to Root Administration Roles -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 4 -+ -+ -+ -+ -+ True -+ False -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 1 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 0 -+ <b>Root Users</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ Root Admin User Role -+ True -+ True -+ False -+ Select Root Administrator User Role, if this user will be used to administer the machine while running as root. This user will not be able to login to the system directly. -+ True -+ True -+ init_radiobutton -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Main Tab -+ -+ -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Enter name of application or user role:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 3 -+ 3 -+ 12 -+ 6 -+ -+ -+ True -+ False -+ 0 -+ Name -+ -+ -+ GTK_FILL -+ -+ -+ -+ -+ -+ True -+ True -+ Enter complete path for executable to be confined. -+ -+ False -+ False -+ True -+ True -+ -+ -+ 1 -+ 2 -+ 1 -+ 2 -+ -+ -+ -+ -+ -+ ... -+ True -+ True -+ False -+ True -+ -+ -+ -+ 2 -+ 3 -+ 1 -+ 2 -+ GTK_FILL -+ -+ -+ -+ -+ -+ True -+ True -+ Enter unique name for the confined application or user role. -+ -+ False -+ False -+ True -+ True -+ -+ -+ 1 -+ 3 -+ -+ -+ -+ -+ -+ True -+ False -+ 0 -+ Executable -+ -+ -+ 1 -+ 2 -+ GTK_FILL -+ -+ -+ -+ -+ -+ True -+ False -+ 0 -+ Init script -+ -+ -+ 2 -+ 3 -+ GTK_FILL -+ -+ -+ -+ -+ -+ True -+ True -+ Enter complete path to init script used to start the confined application. -+ -+ False -+ False -+ True -+ True -+ -+ -+ 1 -+ 2 -+ 2 -+ 3 -+ -+ -+ -+ -+ -+ ... -+ True -+ True -+ False -+ True -+ -+ -+ -+ 2 -+ 3 -+ 2 -+ 3 -+ GTK_FILL -+ -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Name Tab -+ -+ -+ 1 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select existing role to modify:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ automatic -+ automatic -+ in -+ -+ -+ True -+ True -+ Select the user roles that will transiton to the %s domain. -+ False -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ role tab -+ -+ -+ 2 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select roles that %s will transition to:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ -+ -+ True -+ True -+ Select applications domains that %s will transition to. -+ False -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ transition -+role tab -+ -+ -+ 3 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select the user_roles that will transition to %s:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ -+ -+ True -+ True -+ Select the user roles that will transiton to this applications domains. -+ False -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ User Tab -+ -+ -+ 4 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select domains that %s will administer:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ -+ -+ True -+ True -+ Select the domains that you would like this user administer. -+ False -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Admin Tab -+ -+ -+ 5 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select additional roles for %s:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ -+ -+ True -+ True -+ Select the domains that you would like this user administer. -+ False -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Roles Tab -+ -+ -+ 6 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Enter network ports that %s binds on:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 0 -+ <b>TCP Ports</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 12 -+ -+ -+ All -+ True -+ True -+ False -+ Allows %s to bind to any udp port -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ 600-1024 -+ True -+ True -+ False -+ Allow %s to call bindresvport with 0. Binding to port 600-1024 -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 1 -+ -+ -+ -+ -+ Unreserved Ports (>1024) -+ True -+ True -+ False -+ Enter a comma separated list of udp ports or ranges of ports that %s binds to. Example: 612, 650-660 -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 12 -+ -+ -+ True -+ False -+ 0 -+ Select Ports -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ Allows %s to bind to any udp ports > 1024 -+ -+ False -+ False -+ True -+ True -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 0 -+ <b>UDP Ports</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 12 -+ -+ -+ All -+ True -+ True -+ False -+ Allows %s to bind to any udp port -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ 600-1024 -+ True -+ True -+ False -+ Allow %s to call bindresvport with 0. Binding to port 600-1024 -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 1 -+ -+ -+ -+ -+ Unreserved Ports (>1024) -+ True -+ True -+ False -+ Enter a comma separated list of udp ports or ranges of ports that %s binds to. Example: 612, 650-660 -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 12 -+ -+ -+ True -+ False -+ 0 -+ Select Ports -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ Allows %s to bind to any udp ports > 1024 -+ -+ False -+ False -+ True -+ True -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Network -+Bind tab -+ -+ -+ 7 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select network ports that %s connects to:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 0 -+ <b>TCP Ports</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 12 -+ -+ -+ All -+ True -+ True -+ False -+ Allows %s to connect to any tcp port -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 0 -+ Select Ports -+ -+ -+ False -+ False -+ 5 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ Enter a comma separated list of tcp ports or ranges of ports that %s connects to. Example: 612, 650-660 -+ -+ False -+ False -+ True -+ True -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ False -+ 0 -+ <b>UDP Ports</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 12 -+ -+ -+ All -+ True -+ True -+ False -+ Allows %s to connect to any udp port -+ True -+ True -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 0 -+ Select Ports -+ -+ -+ False -+ False -+ 5 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ Enter a comma separated list of udp ports or ranges of ports that %s connects to. Example: 612, 650-660 -+ -+ False -+ False -+ True -+ True -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Network -+Connect Tab -+ -+ -+ 8 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Select common application traits for %s:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 6 -+ -+ -+ Writes syslog messages -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ Create/Manipulate temporary files in /tmp -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ Uses Pam for authentication -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 2 -+ -+ -+ -+ -+ Uses nsswitch or getpw* calls -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 3 -+ -+ -+ -+ -+ Uses dbus -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 4 -+ -+ -+ -+ -+ Sends audit messages -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 5 -+ -+ -+ -+ -+ Interacts with the terminal -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 6 -+ -+ -+ -+ -+ Sends email -+ True -+ True -+ False -+ True -+ True -+ -+ -+ False -+ False -+ 7 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Common -+Tab -+ -+ -+ 9 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Add files/directories that %s manages</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 12 -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ True -+ False -+ -+ -+ -+ True -+ False -+ 0 -+ 0 -+ -+ -+ True -+ False -+ 2 -+ -+ -+ True -+ False -+ gtk-add -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ Add File -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ True -+ False -+ -+ -+ -+ True -+ False -+ 0 -+ 0 -+ -+ -+ True -+ False -+ 2 -+ -+ -+ True -+ False -+ gtk-add -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ Add Directory -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ -+ -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ gtk-delete -+ True -+ True -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 2 -+ -+ -+ -+ -+ False -+ False -+ 4 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ automatic -+ automatic -+ in -+ -+ -+ True -+ True -+ Files/Directories which the %s "manages". Pid Files, Log Files, /var/lib Files ... -+ False -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ Add Tab -+ -+ -+ 10 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Add booleans from the %s policy:</b> -+ True -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 12 -+ -+ -+ True -+ False -+ 6 -+ -+ -+ True -+ True -+ False -+ -+ -+ -+ True -+ False -+ 0 -+ 0 -+ -+ -+ True -+ False -+ 2 -+ -+ -+ True -+ False -+ gtk-add -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ Add Boolean -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ gtk-delete -+ True -+ True -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 4 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ automatic -+ automatic -+ in -+ -+ -+ True -+ True -+ Add/Remove booleans used by the %s domain -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ -+ -+ 11 -+ False -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 0 -+ <b>Which directory you will generate the %s policy?</b> -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ 12 -+ -+ -+ True -+ False -+ Policy Directory -+ -+ -+ False -+ False -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ -+ False -+ False -+ True -+ True -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ ... -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 2 -+ -+ -+ -+ -+ False -+ False -+ 12 -+ 1 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ -+ -+ 12 -+ False -+ -+ -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ True -+ False -+ end -+ -+ -+ gtk-cancel -+ True -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ gtk-go-back -+ True -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ gtk-go-forward -+ True -+ True -+ True -+ False -+ True -+ -+ -+ False -+ False -+ 2 -+ -+ -+ -+ -+ False -+ False -+ 5 -+ 1 -+ -+ -+ -+ -+ -+ -diff --git selinux-gui-2.7/polgengui.py selinux-gui-2.7/polgengui.py -index 7460cce..1601dbe 100644 ---- selinux-gui-2.7/polgengui.py -+++ selinux-gui-2.7/polgengui.py -@@ -22,11 +22,11 @@ - # - import signal - import string --import gtk --import gtk.glade -+import gi -+gi.require_version('Gtk', '3.0') -+from gi.repository import Gtk - import os --import gobject --import gnome -+from gi.repository import GObject - import sys - try: - import sepolicy -@@ -34,7 +34,9 @@ except ValueError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) - sys.exit(1) - -+import sepolicy.generate - import sepolicy.interface -+ - try: - from subprocess import getstatusoutput - except ImportError: -@@ -79,8 +81,6 @@ except: - import __builtin__ - __builtin__.__dict__['_'] = unicode - --gnome.program_init("SELinux Policy Generation Tool", "5") -- - version = "1.0" - - sys.path.append('/usr/share/system-config-selinux') -@@ -95,10 +95,12 @@ def foreach(model, path, iter, selected): - ## - ## Pull in the Glade file - ## --if os.access("polgen.glade", os.F_OK): -- xml = gtk.glade.XML("polgen.glade", domain=PROGNAME) -+xml = Gtk.Builder() -+xml.set_translation_domain(PROGNAME) -+if os.access("polgen.ui", os.F_OK): -+ xml.add_from_file("polgen.ui") - else: -- xml = gtk.glade.XML("/usr/share/system-config-selinux/polgen.glade", domain=PROGNAME) -+ xml.add_from_file("/usr/share/system-config-selinux/polgen.ui") - - FILE = 1 - DIR = 2 -@@ -123,82 +125,82 @@ class childWindow: - - def __init__(self): - self.xml = xml -- self.notebook = xml.get_widget("notebook") -+ self.notebook = xml.get_object("notebook") - self.label_dict = {} - self.tooltip_dict = {} -- label = xml.get_widget("select_label") -+ label = xml.get_object("select_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_user_roles_label") -+ label = xml.get_object("select_user_roles_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_dir_label") -+ label = xml.get_object("select_dir_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_domain_admin_label") -+ label = xml.get_object("select_domain_admin_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_in_label") -+ label = xml.get_object("select_in_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_out_label") -+ label = xml.get_object("select_out_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_common_label") -+ label = xml.get_object("select_common_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_manages_label") -+ label = xml.get_object("select_manages_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("select_booleans_label") -+ label = xml.get_object("select_booleans_label") - self.label_dict[label] = label.get_text() - -- label = xml.get_widget("existing_user_treeview") -+ label = xml.get_object("existing_user_treeview") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("transition_treeview") -+ label = xml.get_object("transition_treeview") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_tcp_all_checkbutton") -+ label = xml.get_object("in_tcp_all_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_tcp_reserved_checkbutton") -+ label = xml.get_object("in_tcp_reserved_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_tcp_unreserved_checkbutton") -+ label = xml.get_object("in_tcp_unreserved_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_tcp_entry") -+ label = xml.get_object("in_tcp_entry") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_udp_all_checkbutton") -+ label = xml.get_object("in_udp_all_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_udp_reserved_checkbutton") -+ label = xml.get_object("in_udp_reserved_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_udp_unreserved_checkbutton") -+ label = xml.get_object("in_udp_unreserved_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("in_udp_entry") -+ label = xml.get_object("in_udp_entry") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("out_tcp_entry") -+ label = xml.get_object("out_tcp_entry") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("out_udp_entry") -+ label = xml.get_object("out_udp_entry") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("out_tcp_all_checkbutton") -+ label = xml.get_object("out_tcp_all_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("out_udp_all_checkbutton") -+ label = xml.get_object("out_udp_all_checkbutton") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("boolean_treeview") -+ label = xml.get_object("boolean_treeview") - self.tooltip_dict[label] = label.get_tooltip_text() - -- label = xml.get_widget("write_treeview") -+ label = xml.get_object("write_treeview") - self.tooltip_dict[label] = label.get_tooltip_text() - - try: -@@ -214,23 +216,26 @@ class childWindow: - self.error(str(e)) - - self.name = "" -- xml.signal_connect("on_delete_clicked", self.delete) -- xml.signal_connect("on_delete_boolean_clicked", self.delete_boolean) -- xml.signal_connect("on_exec_select_clicked", self.exec_select) -- xml.signal_connect("on_init_script_select_clicked", self.init_script_select) -- xml.signal_connect("on_add_clicked", self.add) -- xml.signal_connect("on_add_boolean_clicked", self.add_boolean) -- xml.signal_connect("on_add_dir_clicked", self.add_dir) -- xml.signal_connect("on_about_clicked", self.on_about_clicked) -- xml.get_widget("cancel_button").connect("clicked", self.quit) -- self.forward_button = xml.get_widget("forward_button") -+ handlers = { -+ "on_delete_clicked": self.delete, -+ "on_delete_boolean_clicked": self.delete_boolean, -+ "on_exec_select_clicked": self.exec_select, -+ "on_init_script_select_clicked": self.init_script_select, -+ "on_add_clicked": self.add, -+ "on_add_boolean_clicked": self.add_boolean, -+ "on_add_dir_clicked": self.add_dir, -+ "on_about_clicked": self.on_about_clicked -+ } -+ xml.connect_signals(handlers) -+ xml.get_object("cancel_button").connect("clicked", self.quit) -+ self.forward_button = xml.get_object("forward_button") - self.forward_button.connect("clicked", self.forward) -- self.back_button = xml.get_widget("back_button") -+ self.back_button = xml.get_object("back_button") - self.back_button.connect("clicked", self.back) - -- self.boolean_dialog = xml.get_widget("boolean_dialog") -- self.boolean_name_entry = xml.get_widget("boolean_name_entry") -- self.boolean_description_entry = xml.get_widget("boolean_description_entry") -+ self.boolean_dialog = xml.get_object("boolean_dialog") -+ self.boolean_name_entry = xml.get_object("boolean_name_entry") -+ self.boolean_description_entry = xml.get_object("boolean_description_entry") - - self.pages = {} - for i in sepolicy.generate.USERS: -@@ -249,77 +254,77 @@ class childWindow: - - self.network_buttons = {} - -- self.in_tcp_all_checkbutton = xml.get_widget("in_tcp_all_checkbutton") -- self.in_tcp_reserved_checkbutton = xml.get_widget("in_tcp_reserved_checkbutton") -- self.in_tcp_unreserved_checkbutton = xml.get_widget("in_tcp_unreserved_checkbutton") -- self.in_tcp_entry = self.xml.get_widget("in_tcp_entry") -+ self.in_tcp_all_checkbutton = xml.get_object("in_tcp_all_checkbutton") -+ self.in_tcp_reserved_checkbutton = xml.get_object("in_tcp_reserved_checkbutton") -+ self.in_tcp_unreserved_checkbutton = xml.get_object("in_tcp_unreserved_checkbutton") -+ self.in_tcp_entry = self.xml.get_object("in_tcp_entry") - self.network_buttons[self.in_tcp_all_checkbutton] = [self.in_tcp_reserved_checkbutton, self.in_tcp_unreserved_checkbutton, self.in_tcp_entry] - -- self.out_tcp_all_checkbutton = xml.get_widget("out_tcp_all_checkbutton") -- self.out_tcp_reserved_checkbutton = xml.get_widget("out_tcp_reserved_checkbutton") -- self.out_tcp_unreserved_checkbutton = xml.get_widget("out_tcp_unreserved_checkbutton") -- self.out_tcp_entry = self.xml.get_widget("out_tcp_entry") -+ self.out_tcp_all_checkbutton = xml.get_object("out_tcp_all_checkbutton") -+ self.out_tcp_reserved_checkbutton = xml.get_object("out_tcp_reserved_checkbutton") -+ self.out_tcp_unreserved_checkbutton = xml.get_object("out_tcp_unreserved_checkbutton") -+ self.out_tcp_entry = self.xml.get_object("out_tcp_entry") - - self.network_buttons[self.out_tcp_all_checkbutton] = [self.out_tcp_entry] - -- self.in_udp_all_checkbutton = xml.get_widget("in_udp_all_checkbutton") -- self.in_udp_reserved_checkbutton = xml.get_widget("in_udp_reserved_checkbutton") -- self.in_udp_unreserved_checkbutton = xml.get_widget("in_udp_unreserved_checkbutton") -- self.in_udp_entry = self.xml.get_widget("in_udp_entry") -+ self.in_udp_all_checkbutton = xml.get_object("in_udp_all_checkbutton") -+ self.in_udp_reserved_checkbutton = xml.get_object("in_udp_reserved_checkbutton") -+ self.in_udp_unreserved_checkbutton = xml.get_object("in_udp_unreserved_checkbutton") -+ self.in_udp_entry = self.xml.get_object("in_udp_entry") - - self.network_buttons[self.in_udp_all_checkbutton] = [self.in_udp_reserved_checkbutton, self.in_udp_unreserved_checkbutton, self.in_udp_entry] - -- self.out_udp_all_checkbutton = xml.get_widget("out_udp_all_checkbutton") -- self.out_udp_entry = self.xml.get_widget("out_udp_entry") -+ self.out_udp_all_checkbutton = xml.get_object("out_udp_all_checkbutton") -+ self.out_udp_entry = self.xml.get_object("out_udp_entry") - self.network_buttons[self.out_udp_all_checkbutton] = [self.out_udp_entry] - - for b in self.network_buttons.keys(): - b.connect("clicked", self.network_all_clicked) - -- self.boolean_treeview = self.xml.get_widget("boolean_treeview") -- self.boolean_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) -+ self.boolean_treeview = self.xml.get_object("boolean_treeview") -+ self.boolean_store = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING) - self.boolean_treeview.set_model(self.boolean_store) -- self.boolean_store.set_sort_column_id(0, gtk.SORT_ASCENDING) -- col = gtk.TreeViewColumn(_("Name"), gtk.CellRendererText(), text=0) -+ self.boolean_store.set_sort_column_id(0, Gtk.SortType.ASCENDING) -+ col = Gtk.TreeViewColumn(_("Name"), Gtk.CellRendererText(), text=0) - self.boolean_treeview.append_column(col) -- col = gtk.TreeViewColumn(_("Description"), gtk.CellRendererText(), text=1) -+ col = Gtk.TreeViewColumn(_("Description"), Gtk.CellRendererText(), text=1) - self.boolean_treeview.append_column(col) - -- self.role_treeview = self.xml.get_widget("role_treeview") -- self.role_store = gtk.ListStore(gobject.TYPE_STRING) -+ self.role_treeview = self.xml.get_object("role_treeview") -+ self.role_store = Gtk.ListStore(GObject.TYPE_STRING) - self.role_treeview.set_model(self.role_store) -- self.role_treeview.get_selection().set_mode(gtk.SELECTION_MULTIPLE) -- self.role_store.set_sort_column_id(0, gtk.SORT_ASCENDING) -- col = gtk.TreeViewColumn(_("Role"), gtk.CellRendererText(), text=0) -+ self.role_treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) -+ self.role_store.set_sort_column_id(0, Gtk.SortType.ASCENDING) -+ col = Gtk.TreeViewColumn(_("Role"), Gtk.CellRendererText(), text=0) - self.role_treeview.append_column(col) - -- self.existing_user_treeview = self.xml.get_widget("existing_user_treeview") -- self.existing_user_store = gtk.ListStore(gobject.TYPE_STRING) -+ self.existing_user_treeview = self.xml.get_object("existing_user_treeview") -+ self.existing_user_store = Gtk.ListStore(GObject.TYPE_STRING) - self.existing_user_treeview.set_model(self.existing_user_store) -- self.existing_user_store.set_sort_column_id(0, gtk.SORT_ASCENDING) -- col = gtk.TreeViewColumn(_("Existing_User"), gtk.CellRendererText(), text=0) -+ self.existing_user_store.set_sort_column_id(0, Gtk.SortType.ASCENDING) -+ col = Gtk.TreeViewColumn(_("Existing_User"), Gtk.CellRendererText(), text=0) - self.existing_user_treeview.append_column(col) - - for i in self.all_roles: - iter = self.role_store.append() - self.role_store.set_value(iter, 0, i[:-2]) - -- self.in_tcp_reserved_checkbutton = xml.get_widget("in_tcp_reserved_checkbutton") -+ self.in_tcp_reserved_checkbutton = xml.get_object("in_tcp_reserved_checkbutton") - -- self.transition_treeview = self.xml.get_widget("transition_treeview") -- self.transition_store = gtk.ListStore(gobject.TYPE_STRING) -+ self.transition_treeview = self.xml.get_object("transition_treeview") -+ self.transition_store = Gtk.ListStore(GObject.TYPE_STRING) - self.transition_treeview.set_model(self.transition_store) -- self.transition_treeview.get_selection().set_mode(gtk.SELECTION_MULTIPLE) -- self.transition_store.set_sort_column_id(0, gtk.SORT_ASCENDING) -- col = gtk.TreeViewColumn(_("Application"), gtk.CellRendererText(), text=0) -+ self.transition_treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) -+ self.transition_store.set_sort_column_id(0, Gtk.SortType.ASCENDING) -+ col = Gtk.TreeViewColumn(_("Application"), Gtk.CellRendererText(), text=0) - self.transition_treeview.append_column(col) - -- self.user_transition_treeview = self.xml.get_widget("user_transition_treeview") -- self.user_transition_store = gtk.ListStore(gobject.TYPE_STRING) -+ self.user_transition_treeview = self.xml.get_object("user_transition_treeview") -+ self.user_transition_store = Gtk.ListStore(GObject.TYPE_STRING) - self.user_transition_treeview.set_model(self.user_transition_store) -- self.user_transition_treeview.get_selection().set_mode(gtk.SELECTION_MULTIPLE) -- self.user_transition_store.set_sort_column_id(0, gtk.SORT_ASCENDING) -- col = gtk.TreeViewColumn(_("Application"), gtk.CellRendererText(), text=0) -+ self.user_transition_treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) -+ self.user_transition_store.set_sort_column_id(0, Gtk.SortType.ASCENDING) -+ col = Gtk.TreeViewColumn(_("Application"), Gtk.CellRendererText(), text=0) - self.user_transition_treeview.append_column(col) - - for i in self.all_users: -@@ -328,12 +333,12 @@ class childWindow: - iter = self.existing_user_store.append() - self.existing_user_store.set_value(iter, 0, i[:-2]) - -- self.admin_treeview = self.xml.get_widget("admin_treeview") -- self.admin_store = gtk.ListStore(gobject.TYPE_STRING) -+ self.admin_treeview = self.xml.get_object("admin_treeview") -+ self.admin_store = Gtk.ListStore(GObject.TYPE_STRING) - self.admin_treeview.set_model(self.admin_store) -- self.admin_treeview.get_selection().set_mode(gtk.SELECTION_MULTIPLE) -- self.admin_store.set_sort_column_id(0, gtk.SORT_ASCENDING) -- col = gtk.TreeViewColumn(_("Application"), gtk.CellRendererText(), text=0) -+ self.admin_treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) -+ self.admin_store.set_sort_column_id(0, Gtk.SortType.ASCENDING) -+ col = Gtk.TreeViewColumn(_("Application"), Gtk.CellRendererText(), text=0) - self.admin_treeview.append_column(col) - - try: -@@ -383,17 +388,17 @@ class childWindow: - - if self.pages[type][self.current_page] == self.FINISH_PAGE: - self.generate_policy() -- self.xml.get_widget("cancel_button").set_label(gtk.STOCK_CLOSE) -+ self.xml.get_object("cancel_button").set_label(Gtk.STOCK_CLOSE) - else: - self.current_page = self.current_page + 1 - self.notebook.set_current_page(self.pages[type][self.current_page]) - if self.pages[type][self.current_page] == self.FINISH_PAGE: -- self.forward_button.set_label(gtk.STOCK_APPLY) -+ self.forward_button.set_label(Gtk.STOCK_APPLY) - - def back(self, arg): - type = self.get_type() - if self.pages[type][self.current_page] == self.FINISH_PAGE: -- self.forward_button.set_label(gtk.STOCK_GO_FORWARD) -+ self.forward_button.set_label(Gtk.STOCK_GO_FORWARD) - - self.current_page = self.current_page - 1 - self.notebook.set_current_page(self.pages[type][self.current_page]) -@@ -406,30 +411,30 @@ class childWindow: - b.set_sensitive(not active) - - def verify(self, message, title=""): -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, -- gtk.BUTTONS_YES_NO, -+ dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, -+ Gtk.ButtonsType.YES_NO, - message) - dlg.set_title(title) -- dlg.set_position(gtk.WIN_POS_MOUSE) -+ dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - rc = dlg.run() - dlg.destroy() - return rc - - def info(self, message): -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, -- gtk.BUTTONS_OK, -+ dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, -+ Gtk.ButtonsType.OK, - message) -- dlg.set_position(gtk.WIN_POS_MOUSE) -+ dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - dlg.run() - dlg.destroy() - - def error(self, message): -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, -- gtk.BUTTONS_CLOSE, -+ dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.ERROR, -+ Gtk.ButtonsType.CLOSE, - message) -- dlg.set_position(gtk.WIN_POS_MOUSE) -+ dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - dlg.run() - dlg.destroy() -@@ -550,7 +555,7 @@ class childWindow: - self.boolean_description_entry.set_text("") - rc = self.boolean_dialog.run() - self.boolean_dialog.hide() -- if rc == gtk.RESPONSE_CANCEL: -+ if rc == Gtk.ResponseType.CANCEL: - return - iter = self.boolean_store.append() - self.boolean_store.set_value(iter, 0, self.boolean_name_entry.get_text()) -@@ -559,7 +564,7 @@ class childWindow: - def __add(self, type): - rc = self.file_dialog.run() - self.file_dialog.hide() -- if rc == gtk.RESPONSE_CANCEL: -+ if rc == Gtk.ResponseType.CANCEL: - return - for i in self.file_dialog.get_filenames(): - iter = self.store.append() -@@ -569,29 +574,29 @@ class childWindow: - def exec_select(self, args): - self.file_dialog.set_select_multiple(0) - self.file_dialog.set_title(_("Select executable file to be confined.")) -- self.file_dialog.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) -+ self.file_dialog.set_action(Gtk.FileChooserAction.OPEN) - self.file_dialog.set_current_folder("/usr/sbin") - rc = self.file_dialog.run() - self.file_dialog.hide() -- if rc == gtk.RESPONSE_CANCEL: -+ if rc == Gtk.ResponseType.CANCEL: - return - self.exec_entry.set_text(self.file_dialog.get_filename()) - - def init_script_select(self, args): - self.file_dialog.set_select_multiple(0) - self.file_dialog.set_title(_("Select init script file to be confined.")) -- self.file_dialog.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) -+ self.file_dialog.set_action(Gtk.FileChooserAction.OPEN) - self.file_dialog.set_current_folder("/etc/rc.d/init.d") - rc = self.file_dialog.run() - self.file_dialog.hide() -- if rc == gtk.RESPONSE_CANCEL: -+ if rc == Gtk.ResponseType.CANCEL: - return - self.init_script_entry.set_text(self.file_dialog.get_filename()) - - def add(self, args): - self.file_dialog.set_title(_("Select file(s) that confined application creates or writes")) - self.file_dialog.set_current_folder("/") -- self.file_dialog.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) -+ self.file_dialog.set_action(Gtk.FileChooserAction.OPEN) - self.file_dialog.set_select_multiple(1) - self.__add(FILE) - -@@ -599,87 +604,87 @@ class childWindow: - self.file_dialog.set_title(_("Select directory(s) that the confined application owns and writes into")) - self.file_dialog.set_current_folder("/") - self.file_dialog.set_select_multiple(1) -- self.file_dialog.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) -+ self.file_dialog.set_action(Gtk.FileChooserAction.SELECT_FOLDER) - self.__add(DIR) - - def on_about_clicked(self, args): -- dlg = xml.get_widget("about_dialog") -+ dlg = xml.get_object("about_dialog") - dlg.run() - dlg.hide() - - def quit(self, args): -- gtk.main_quit() -+ Gtk.main_quit() - - def setupScreen(self): - # Bring in widgets from glade file. -- self.mainWindow = self.xml.get_widget("main_window") -- self.druid = self.xml.get_widget("druid") -+ self.mainWindow = self.xml.get_object("main_window") -+ self.druid = self.xml.get_object("druid") - self.type = 0 -- self.name_entry = self.xml.get_widget("name_entry") -+ self.name_entry = self.xml.get_object("name_entry") - self.name_entry.connect("insert_text", self.on_name_entry_changed) - self.name_entry.connect("focus_out_event", self.on_focus_out_event) -- self.exec_entry = self.xml.get_widget("exec_entry") -- self.exec_button = self.xml.get_widget("exec_button") -- self.init_script_entry = self.xml.get_widget("init_script_entry") -- self.init_script_button = self.xml.get_widget("init_script_button") -- self.output_entry = self.xml.get_widget("output_entry") -+ self.exec_entry = self.xml.get_object("exec_entry") -+ self.exec_button = self.xml.get_object("exec_button") -+ self.init_script_entry = self.xml.get_object("init_script_entry") -+ self.init_script_button = self.xml.get_object("init_script_button") -+ self.output_entry = self.xml.get_object("output_entry") - self.output_entry.set_text(os.getcwd()) -- self.xml.get_widget("output_button").connect("clicked", self.output_button_clicked) -- -- self.xwindows_user_radiobutton = self.xml.get_widget("xwindows_user_radiobutton") -- self.terminal_user_radiobutton = self.xml.get_widget("terminal_user_radiobutton") -- self.root_user_radiobutton = self.xml.get_widget("root_user_radiobutton") -- self.login_user_radiobutton = self.xml.get_widget("login_user_radiobutton") -- self.admin_user_radiobutton = self.xml.get_widget("admin_user_radiobutton") -- self.existing_user_radiobutton = self.xml.get_widget("existing_user_radiobutton") -- -- self.user_radiobutton = self.xml.get_widget("user_radiobutton") -- self.init_radiobutton = self.xml.get_widget("init_radiobutton") -- self.inetd_radiobutton = self.xml.get_widget("inetd_radiobutton") -- self.dbus_radiobutton = self.xml.get_widget("dbus_radiobutton") -- self.cgi_radiobutton = self.xml.get_widget("cgi_radiobutton") -- self.sandbox_radiobutton = self.xml.get_widget("sandbox_radiobutton") -- self.tmp_checkbutton = self.xml.get_widget("tmp_checkbutton") -- self.uid_checkbutton = self.xml.get_widget("uid_checkbutton") -- self.pam_checkbutton = self.xml.get_widget("pam_checkbutton") -- self.dbus_checkbutton = self.xml.get_widget("dbus_checkbutton") -- self.audit_checkbutton = self.xml.get_widget("audit_checkbutton") -- self.terminal_checkbutton = self.xml.get_widget("terminal_checkbutton") -- self.mail_checkbutton = self.xml.get_widget("mail_checkbutton") -- self.syslog_checkbutton = self.xml.get_widget("syslog_checkbutton") -- self.view = self.xml.get_widget("write_treeview") -- self.file_dialog = self.xml.get_widget("filechooserdialog") -- -- self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_INT) -+ self.xml.get_object("output_button").connect("clicked", self.output_button_clicked) -+ -+ self.xwindows_user_radiobutton = self.xml.get_object("xwindows_user_radiobutton") -+ self.terminal_user_radiobutton = self.xml.get_object("terminal_user_radiobutton") -+ self.root_user_radiobutton = self.xml.get_object("root_user_radiobutton") -+ self.login_user_radiobutton = self.xml.get_object("login_user_radiobutton") -+ self.admin_user_radiobutton = self.xml.get_object("admin_user_radiobutton") -+ self.existing_user_radiobutton = self.xml.get_object("existing_user_radiobutton") -+ -+ self.user_radiobutton = self.xml.get_object("user_radiobutton") -+ self.init_radiobutton = self.xml.get_object("init_radiobutton") -+ self.inetd_radiobutton = self.xml.get_object("inetd_radiobutton") -+ self.dbus_radiobutton = self.xml.get_object("dbus_radiobutton") -+ self.cgi_radiobutton = self.xml.get_object("cgi_radiobutton") -+ self.sandbox_radiobutton = self.xml.get_object("sandbox_radiobutton") -+ self.tmp_checkbutton = self.xml.get_object("tmp_checkbutton") -+ self.uid_checkbutton = self.xml.get_object("uid_checkbutton") -+ self.pam_checkbutton = self.xml.get_object("pam_checkbutton") -+ self.dbus_checkbutton = self.xml.get_object("dbus_checkbutton") -+ self.audit_checkbutton = self.xml.get_object("audit_checkbutton") -+ self.terminal_checkbutton = self.xml.get_object("terminal_checkbutton") -+ self.mail_checkbutton = self.xml.get_object("mail_checkbutton") -+ self.syslog_checkbutton = self.xml.get_object("syslog_checkbutton") -+ self.view = self.xml.get_object("write_treeview") -+ self.file_dialog = self.xml.get_object("filechooserdialog") -+ -+ self.store = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_INT) - self.view.set_model(self.store) -- col = gtk.TreeViewColumn("", gtk.CellRendererText(), text=0) -+ col = Gtk.TreeViewColumn("", Gtk.CellRendererText(), text=0) - col.set_resizable(True) - self.view.append_column(col) - self.view.get_selection().select_path((0,)) - - def output_button_clicked(self, *args): - self.file_dialog.set_title(_("Select directory to generate policy files in")) -- self.file_dialog.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) -+ self.file_dialog.set_action(Gtk.FileChooserAction.SELECT_FOLDER) - self.file_dialog.set_select_multiple(0) - rc = self.file_dialog.run() - self.file_dialog.hide() -- if rc == gtk.RESPONSE_CANCEL: -+ if rc == Gtk.ResponseType.CANCEL: - return - self.output_entry.set_text(self.file_dialog.get_filename()) - - def on_name_entry_changed(self, entry, text, size, position): - if text.find(" ") >= 0: -- entry.emit_stop_by_name("insert_text") -+ entry.stop_emission_by_name("insert-text") - - def on_focus_out_event(self, entry, third): - name = entry.get_text() - if self.name != name: - if name in self.all_types: -- if self.verify(_("Type %s_t already defined in current policy.\nDo you want to continue?") % name, _("Verify Name")) == gtk.RESPONSE_NO: -+ if self.verify(_("Type %s_t already defined in current policy.\nDo you want to continue?") % name, _("Verify Name")) == Gtk.ResponseType.NO: - entry.set_text("") - return False - if name in self.all_modules: -- if self.verify(_("Module %s already loaded in current policy.\nDo you want to continue?") % name, _("Verify Name")) == gtk.RESPONSE_NO: -+ if self.verify(_("Module %s already loaded in current policy.\nDo you want to continue?") % name, _("Verify Name")) == Gtk.ResponseType.NO: - entry.set_text("") - return False - -@@ -696,16 +701,16 @@ class childWindow: - - def on_in_net_page_next(self, *args): - try: -- generate.verify_ports(self.in_tcp_entry.get_text()) -- generate.verify_ports(self.in_udp_entry.get_text()) -+ sepolicy.generate.verify_ports(self.in_tcp_entry.get_text()) -+ sepolicy.generate.verify_ports(self.in_udp_entry.get_text()) - except ValueError as e: - self.error(e.message) - return True - - def on_out_net_page_next(self, *args): - try: -- generate.verify_ports(self.out_tcp_entry.get_text()) -- generate.verify_ports(self.out_udp_entry.get_text()) -+ sepolicy.generate.verify_ports(self.out_tcp_entry.get_text()) -+ sepolicy.generate.verify_ports(self.out_udp_entry.get_text()) - except ValueError as e: - self.error(e.message) - return True -@@ -741,7 +746,7 @@ class childWindow: - if exe == "": - self.error(_("You must enter a executable")) - return True -- policy = generate.policy(name, self.get_type()) -+ policy = sepolicy.generate.policy(name, self.get_type()) - policy.set_program(exe) - policy.gen_writeable() - policy.gen_symbols() -@@ -770,7 +775,7 @@ class childWindow: - self.mainWindow.connect("destroy", self.quit) - - self.mainWindow.show_all() -- gtk.main() -+ Gtk.main() - - if __name__ == "__main__": - signal.signal(signal.SIGINT, signal.SIG_DFL) -diff --git selinux-gui-2.7/portsPage.py selinux-gui-2.7/portsPage.py -index b8fdaad..30f5838 100644 ---- selinux-gui-2.7/portsPage.py -+++ selinux-gui-2.7/portsPage.py -@@ -16,12 +16,8 @@ - ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - ## Author: Dan Walsh --import string --import gtk --import gtk.glade --import os --import gobject - import sys -+from gi.repository import GObject, Gtk - import seobject - - TYPE_COL = 0 -@@ -62,18 +58,19 @@ class portsPage(semanagePage): - - def __init__(self, xml): - semanagePage.__init__(self, xml, "ports", _("Network Port")) -- xml.signal_connect("on_group_clicked", self.on_group_clicked) -+ group_listview = xml.get_object("listViewButton") -+ group_listview.connect("clicked", self.on_group_clicked) - self.group = False -- self.ports_filter = xml.get_widget("portsFilterEntry") -+ self.ports_filter = xml.get_object("portsFilterEntry") - self.ports_filter.connect("focus_out_event", self.filter_changed) - self.ports_filter.connect("activate", self.filter_changed) -- self.ports_name_entry = xml.get_widget("portsNameEntry") -- self.ports_protocol_combo = xml.get_widget("portsProtocolCombo") -- self.ports_number_entry = xml.get_widget("portsNumberEntry") -- self.ports_mls_entry = xml.get_widget("portsMLSEntry") -- self.ports_add_button = xml.get_widget("portsAddButton") -- self.ports_properties_button = xml.get_widget("portsPropertiesButton") -- self.ports_delete_button = xml.get_widget("portsDeleteButton") -+ self.ports_name_entry = xml.get_object("portsNameEntry") -+ self.ports_protocol_combo = xml.get_object("portsProtocolCombo") -+ self.ports_number_entry = xml.get_object("portsNumberEntry") -+ self.ports_mls_entry = xml.get_object("portsMLSEntry") -+ self.ports_add_button = xml.get_object("portsAddButton") -+ self.ports_properties_button = xml.get_object("portsPropertiesButton") -+ self.ports_delete_button = xml.get_object("portsDeleteButton") - liststore = self.ports_protocol_combo.get_model() - iter = liststore.get_iter_first() - self.ports_protocol_combo.set_active_iter(iter) -@@ -90,28 +87,28 @@ class portsPage(semanagePage): - self.group_load(filter) - - def init_store(self): -- self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) -+ self.store = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING) - self.view.set_model(self.store) -- self.store.set_sort_column_id(0, gtk.SORT_ASCENDING) -+ self.store.set_sort_column_id(0, Gtk.SortType.ASCENDING) - - self.view.set_search_equal_func(self.search) -- col = gtk.TreeViewColumn(_("SELinux Port\nType"), gtk.CellRendererText(), text=TYPE_COL) -+ col = Gtk.TreeViewColumn(_("SELinux Port\nType"), Gtk.CellRendererText(), text=TYPE_COL) - col.set_sort_column_id(TYPE_COL) - col.set_resizable(True) - self.view.append_column(col) -- self.store.set_sort_column_id(TYPE_COL, gtk.SORT_ASCENDING) -+ self.store.set_sort_column_id(TYPE_COL, Gtk.SortType.ASCENDING) - -- col = gtk.TreeViewColumn(_("Protocol"), gtk.CellRendererText(), text=PROTOCOL_COL) -+ col = Gtk.TreeViewColumn(_("Protocol"), Gtk.CellRendererText(), text=PROTOCOL_COL) - col.set_sort_column_id(PROTOCOL_COL) - col.set_resizable(True) - self.view.append_column(col) - -- self.mls_col = gtk.TreeViewColumn(_("MLS/MCS\nLevel"), gtk.CellRendererText(), text=MLS_COL) -+ self.mls_col = Gtk.TreeViewColumn(_("MLS/MCS\nLevel"), Gtk.CellRendererText(), text=MLS_COL) - self.mls_col.set_resizable(True) - self.mls_col.set_sort_column_id(MLS_COL) - self.view.append_column(self.mls_col) - -- col = gtk.TreeViewColumn(_("Port"), gtk.CellRendererText(), text=PORT_COL) -+ col = Gtk.TreeViewColumn(_("Port"), Gtk.CellRendererText(), text=PORT_COL) - col.set_sort_column_id(PORT_COL) - col.set_resizable(True) - self.view.append_column(col) -@@ -139,7 +136,7 @@ class portsPage(semanagePage): - continue - iter = self.store.append() - if k[0] == k[1]: -- self.store.set_value(iter, PORT_COL, k[0]) -+ self.store.set_value(iter, PORT_COL, str(k[0])) - else: - rec = "%s-%s" % k[:2] - self.store.set_value(iter, PORT_COL, rec) -diff --git selinux-gui-2.7/semanagePage.py selinux-gui-2.7/semanagePage.py -index 27367f3..4127804 100644 ---- selinux-gui-2.7/semanagePage.py -+++ selinux-gui-2.7/semanagePage.py -@@ -16,13 +16,8 @@ - ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - ## Author: Dan Walsh --import string --import gtk --import gtk.glade --import os --import gobject - import sys --import seobject -+from gi.repository import Gdk, Gtk - - ## - ## I18N -@@ -47,24 +42,25 @@ except: - - - def idle_func(): -- while gtk.events_pending(): -- gtk.main_iteration() -+ while Gtk.events_pending(): -+ Gtk.main_iteration() - - - class semanagePage: - - def __init__(self, xml, name, description): - self.xml = xml -- self.window = self.xml.get_widget("mainWindow").get_root_window() -- self.busy_cursor = gtk.gdk.Cursor(gtk.gdk.WATCH) -- self.ready_cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR) -+ self.window = self.xml.get_object("mainWindow").get_root_window() -+ self.busy_cursor = Gdk.Cursor.new(Gdk.CursorType.WATCH) -+ self.ready_cursor = Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR) - - self.local = False -- self.view = xml.get_widget("%sView" % name) -- self.dialog = xml.get_widget("%sDialog" % name) -- self.filter_entry = xml.get_widget("%sFilterEntry" % name) -+ self.view = xml.get_object("%sView" % name) -+ self.dialog = xml.get_object("%sDialog" % name) -+ self.filter_entry = xml.get_object("%sFilterEntry" % name) - self.filter_entry.connect("focus_out_event", self.filter_changed) - self.filter_entry.connect("activate", self.filter_changed) -+ self.filter_entry.connect("changed", self.filter_changed) - - self.view.connect("row_activated", self.rowActivated) - self.view.get_selection().connect("changed", self.itemSelected) -@@ -81,7 +77,7 @@ class semanagePage: - def get_description(self): - return self.description - -- def itemSelected(self, args): -+ def itemSelected(self, selection): - return - - def filter_changed(self, *arg): -@@ -110,28 +106,28 @@ class semanagePage: - self.propertiesDialog() - - def verify(self, message, title=""): -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, -- gtk.BUTTONS_YES_NO, -+ dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, -+ Gtk.ButtonsType.YES_NO, - message) - dlg.set_title(title) -- dlg.set_position(gtk.WIN_POS_MOUSE) -+ dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - rc = dlg.run() - dlg.destroy() - return rc - - def error(self, message): -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, -- gtk.BUTTONS_CLOSE, -+ dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.ERROR, -+ Gtk.ButtonsType.CLOSE, - message) -- dlg.set_position(gtk.WIN_POS_MOUSE) -+ dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - dlg.run() - dlg.destroy() - - def deleteDialog(self): - store, it = self.view.get_selection().get_selected() -- if (it is not None) and (self.verify(_("Are you sure you want to delete %s '%s'?" % (self.description, store.get_value(it, 0))), _("Delete %s" % self.description)) == gtk.RESPONSE_YES): -+ if (it is not None) and (self.verify(_("Are you sure you want to delete %s '%s'?" % (self.description, store.get_value(it, 0))), _("Delete %s" % self.description)) == Gtk.ResponseType.YES): - self.delete() - - def use_menus(self): -@@ -140,11 +136,11 @@ class semanagePage: - def addDialog(self): - self.dialogClear() - self.dialog.set_title(_("Add %s" % self.description)) -- self.dialog.set_position(gtk.WIN_POS_MOUSE) -+ self.dialog.set_position(Gtk.WindowPosition.MOUSE) - -- while self.dialog.run() == gtk.RESPONSE_OK: -+ while self.dialog.run() == Gtk.ResponseType.OK: - try: -- if self.add() == False: -+ if self.add() is False: - continue - break - except ValueError as e: -@@ -154,10 +150,10 @@ class semanagePage: - def propertiesDialog(self): - self.dialogInit() - self.dialog.set_title(_("Modify %s" % self.description)) -- self.dialog.set_position(gtk.WIN_POS_MOUSE) -- while self.dialog.run() == gtk.RESPONSE_OK: -+ self.dialog.set_position(Gtk.WindowPosition.MOUSE) -+ while self.dialog.run() == Gtk.ResponseType.OK: - try: -- if self.modify() == False: -+ if self.modify() is False: - continue - break - except ValueError as e: -diff --git selinux-gui-2.7/statusPage.py selinux-gui-2.7/statusPage.py -index 23d0d0f..766854b 100644 ---- selinux-gui-2.7/statusPage.py -+++ selinux-gui-2.7/statusPage.py -@@ -16,23 +16,14 @@ - ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - ## Author: Dan Walsh --import string --import gtk --import gtk.glade - import os --import gobject - import sys --import tempfile -+from gi.repository import Gtk - import selinux - - INSTALLPATH = '/usr/share/system-config-selinux' - sys.path.append(INSTALLPATH) - --try: -- from subprocess import getstatusoutput --except ImportError: -- from commands import getstatusoutput -- - ENFORCING = 1 - PERMISSIVE = 0 - DISABLED = -1 -@@ -71,12 +62,11 @@ class statusPage: - - self.type = selinux.selinux_getpolicytype() - # Bring in widgets from glade file. -- self.typeHBox = xml.get_widget("typeHBox") -- self.selinuxTypeOptionMenu = xml.get_widget("selinuxTypeOptionMenu") -- self.typeLabel = xml.get_widget("typeLabel") -- self.enabledOptionMenu = xml.get_widget("enabledOptionMenu") -- self.currentOptionMenu = xml.get_widget("currentOptionMenu") -- self.relabel_checkbutton = xml.get_widget("relabelCheckbutton") -+ self.selinuxTypeOptionMenu = xml.get_object("selinuxTypeOptionMenu") -+ self.typeLabel = xml.get_object("typeLabel") -+ self.enabledOptionMenu = xml.get_object("enabledOptionMenu") -+ self.currentOptionMenu = xml.get_object("currentOptionMenu") -+ self.relabel_checkbutton = xml.get_object("relabelCheckbutton") - self.relabel_checkbutton.set_active(self.is_relabel()) - self.relabel_checkbutton.connect("toggled", self.on_relabel_toggle) - if self.get_current_mode() == ENFORCING or self.get_current_mode() == PERMISSIVE: -@@ -90,7 +80,7 @@ class statusPage: - self.currentOptionMenu.set_active(0) - self.currentOptionMenu.set_sensitive(False) - -- if self.read_selinux_config() == None: -+ if self.read_selinux_config() is None: - self.selinuxsupport = False - else: - self.enabledOptionMenu.connect("changed", self.enabled_changed) -@@ -131,10 +121,10 @@ class statusPage: - os.unlink(RELABELFILE) - - def verify(self, message): -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, -- gtk.BUTTONS_YES_NO, -+ dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, -+ Gtk.ButtonsType.YES_NO, - message) -- dlg.set_position(gtk.WIN_POS_MOUSE) -+ dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - rc = dlg.run() - dlg.destroy() -@@ -144,7 +134,7 @@ class statusPage: - type = self.get_type() - enabled = self.enabledOptionMenu.get_active() - if self.initialtype != type: -- if self.verify(_("Changing the policy type will cause a relabel of the entire file system on the next boot. Relabeling takes a long time depending on the size of the file system. Do you wish to continue?")) == gtk.RESPONSE_NO: -+ if self.verify(_("Changing the policy type will cause a relabel of the entire file system on the next boot. Relabeling takes a long time depending on the size of the file system. Do you wish to continue?")) == Gtk.ResponseType.NO: - menu.set_active(self.typeHistory) - return None - -@@ -158,12 +148,12 @@ class statusPage: - type = self.get_type() - - if self.initEnabled != DISABLED and enabled == DISABLED: -- if self.verify(_("Changing to SELinux disabled requires a reboot. It is not recommended. If you later decide to turn SELinux back on, the system will be required to relabel. If you just want to see if SELinux is causing a problem on your system, you can go to permissive mode which will only log errors and not enforce SELinux policy. Permissive mode does not require a reboot Do you wish to continue?")) == gtk.RESPONSE_NO: -+ if self.verify(_("Changing to SELinux disabled requires a reboot. It is not recommended. If you later decide to turn SELinux back on, the system will be required to relabel. If you just want to see if SELinux is causing a problem on your system, you can go to permissive mode which will only log errors and not enforce SELinux policy. Permissive mode does not require a reboot Do you wish to continue?")) == Gtk.ResponseType.NO: - combo.set_active(self.enabled) - return None - - if self.initEnabled == DISABLED and enabled < 2: -- if self.verify(_("Changing to SELinux enabled will cause a relabel of the entire file system on the next boot. Relabeling takes a long time depending on the size of the file system. Do you wish to continue?")) == gtk.RESPONSE_NO: -+ if self.verify(_("Changing to SELinux enabled will cause a relabel of the entire file system on the next boot. Relabeling takes a long time depending on the size of the file system. Do you wish to continue?")) == Gtk.ResponseType.NO: - combo.set_active(self.enabled) - return None - self.relabel_checkbutton.set_active(True) -diff --git selinux-gui-2.7/system-config-selinux.py selinux-gui-2.7/system-config-selinux.py -index ed41e98..ce7c74b 100644 ---- selinux-gui-2.7/system-config-selinux.py -+++ selinux-gui-2.7/system-config-selinux.py -@@ -20,20 +20,19 @@ - # along with this program; if not, write to the Free Software - # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - # -+import os - import signal --import string - import sys -+import gi -+gi.require_version('Gtk', '3.0') - try: -- import gtk -+ from gi.repository import Gtk - except RuntimeError as e: - print("system-config-selinux:", e) - print("This is a graphical application and requires DISPLAY to be set.") - sys.exit(1) - --import gtk.glade --import os --import gobject --import gnome -+from gi.repository import GObject - import statusPage - import booleansPage - import loginsPage -@@ -64,8 +63,6 @@ except: - import __builtin__ - __builtin__.__dict__['_'] = unicode - --gnome.program_init("SELinux Management Tool", "5") -- - version = "1.0" - - sys.path.append('/usr/share/system-config-selinux') -@@ -74,10 +71,12 @@ sys.path.append('/usr/share/system-config-selinux') - ## - ## Pull in the Glade file - ## --if os.access("system-config-selinux.glade", os.F_OK): -- xml = gtk.glade.XML("system-config-selinux.glade", domain=PROGNAME) -+xml = Gtk.Builder() -+xml.set_translation_domain(PROGNAME) -+if os.access("system-config-selinux.ui", os.F_OK): -+ xml.add_from_file("system-config-selinux.ui") - else: -- xml = gtk.glade.XML("/usr/share/system-config-selinux/system-config-selinux.glade", domain=PROGNAME) -+ xml.add_from_file("/usr/share/system-config-selinux/system-config-selinux.ui") - - - class childWindow: -@@ -85,11 +84,16 @@ class childWindow: - def __init__(self): - self.tabs = [] - self.xml = xml -- xml.signal_connect("on_quit_activate", self.destroy) -- xml.signal_connect("on_delete_clicked", self.delete) -- xml.signal_connect("on_add_clicked", self.add) -- xml.signal_connect("on_properties_clicked", self.properties) -- xml.signal_connect("on_local_clicked", self.on_local_clicked) -+ xml.connect_signals({ -+ "on_quit_activate": self.destroy, -+ "on_delete_clicked": self.delete, -+ "on_add_clicked": self.add, -+ "on_properties_clicked": self.properties, -+ "on_local_clicked": self.on_local_clicked, -+ "on_policy_activate": self.policy, -+ "on_logging_activate": self.logging, -+ "on_about_activate": self.on_about_activate, -+ }) - self.add_page(statusPage.statusPage(xml)) - if selinux.is_selinux_enabled() > 0: - try: -@@ -103,20 +107,15 @@ class childWindow: - except ValueError as e: - self.error(e.message) - -- xml.signal_connect("on_quit_activate", self.destroy) -- xml.signal_connect("on_policy_activate", self.policy) -- xml.signal_connect("on_logging_activate", self.logging) -- xml.signal_connect("on_about_activate", self.on_about_activate) -- -- self.add_menu = xml.get_widget("add_menu_item") -- self.properties_menu = xml.get_widget("properties_menu_item") -- self.delete_menu = xml.get_widget("delete_menu_item") -+ self.add_menu = xml.get_object("add_menu_item") -+ self.properties_menu = xml.get_object("properties_menu_item") -+ self.delete_menu = xml.get_object("delete_menu_item") - - def error(self, message): -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, -- gtk.BUTTONS_CLOSE, -+ dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.ERROR, -+ Gtk.ButtonsType.CLOSE, - message) -- dlg.set_position(gtk.WIN_POS_MOUSE) -+ dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - dlg.run() - dlg.destroy() -@@ -143,12 +142,12 @@ class childWindow: - self.tabs[self.notebook.get_current_page()].on_local_clicked(button) - - def on_about_activate(self, args): -- dlg = xml.get_widget("aboutWindow") -+ dlg = xml.get_object("aboutWindow") - dlg.run() - dlg.hide() - - def destroy(self, args): -- gtk.main_quit() -+ Gtk.main_quit() - - def use_menus(self, use_menus): - self.add_menu.set_sensitive(use_menus) -@@ -166,13 +165,13 @@ class childWindow: - - def setupScreen(self): - # Bring in widgets from glade file. -- self.mainWindow = self.xml.get_widget("mainWindow") -- self.notebook = self.xml.get_widget("notebook") -- self.view = self.xml.get_widget("selectView") -+ self.mainWindow = self.xml.get_object("mainWindow") -+ self.notebook = self.xml.get_object("notebook") -+ self.view = self.xml.get_object("selectView") - self.view.get_selection().connect("changed", self.itemSelected) -- self.store = gtk.ListStore(gobject.TYPE_STRING) -+ self.store = Gtk.ListStore(GObject.TYPE_STRING) - self.view.set_model(self.store) -- col = gtk.TreeViewColumn("", gtk.CellRendererText(), text=0) -+ col = Gtk.TreeViewColumn("", Gtk.CellRendererText(), text=0) - col.set_resizable(True) - self.view.append_column(col) - -@@ -189,7 +188,7 @@ class childWindow: - self.mainWindow.connect("destroy", self.destroy) - - self.mainWindow.show_all() -- gtk.main() -+ Gtk.main() - - if __name__ == "__main__": - signal.signal(signal.SIGINT, signal.SIG_DFL) -diff --git selinux-gui-2.7/system-config-selinux.ui selinux-gui-2.7/system-config-selinux.ui -new file mode 100644 -index 0000000..7cc1cc5 ---- /dev/null -+++ selinux-gui-2.7/system-config-selinux.ui -@@ -0,0 +1,2024 @@ -+ -+ -+ -+ -+ -+ -+ system-config-selinux -+ False -+ 5 -+ normal -+ Copyright (c)2006 Red Hat, Inc. -+Copyright (c) 2006 Dan Walsh <dwalsh@redhat.com> -+ Daniel Walsh <dwalsh@redhat.com> -+ -+ translator-credits -+ system-config-selinux.png -+ -+ -+ False -+ -+ -+ False -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ True -+ False -+ gtk-add -+ -+ -+ True -+ False -+ gtk-properties -+ -+ -+ True -+ False -+ gtk-delete -+ -+ -+ False -+ Add SELinux Login Mapping -+ dialog -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ end -+ -+ -+ gtk-cancel -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ gtk-ok -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ 4 -+ 6 -+ -+ -+ True -+ False -+ Login Name -+ -+ -+ 0 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ SELinux User -+ -+ -+ 0 -+ 1 -+ -+ -+ -+ -+ True -+ False -+ MLS/MCS Range -+ -+ -+ 0 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ 1 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ cancelbutton1 -+ okbutton1 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ tcp -+ -+ -+ udp -+ -+ -+ -+ -+ False -+ Add SELinux Network Ports -+ dialog -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ end -+ -+ -+ gtk-cancel -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ gtk-ok -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ 4 -+ 6 -+ -+ -+ True -+ False -+ Port Number -+ -+ -+ 0 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ Protocol -+ -+ -+ 0 -+ 1 -+ -+ -+ -+ -+ True -+ False -+ SELinux Type -+ -+ -+ 0 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ model1 -+ -+ -+ -+ 0 -+ -+ -+ -+ -+ 1 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 2 -+ -+ -+ -+ -+ True -+ False -+ MLS/MCS -+Level -+ -+ -+ 0 -+ 3 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 3 -+ -+ -+ -+ -+ True -+ True -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ button1 -+ button2 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ all files -+ -+ -+ regular file -+ -+ -+ directory -+ -+ -+ character device -+ -+ -+ block device -+ -+ -+ socket file -+ -+ -+ symbolic link -+ -+ -+ named pipe -+ -+ -+ -+ -+ False -+ Add SELinux Login Mapping -+ dialog -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ end -+ -+ -+ gtk-cancel -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ gtk-ok -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ 4 -+ 6 -+ -+ -+ True -+ False -+ File Specification -+ -+ -+ 0 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ File Type -+ -+ -+ 0 -+ 1 -+ -+ -+ -+ -+ True -+ False -+ SELinux Type -+ -+ -+ 0 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ model2 -+ -+ -+ -+ 0 -+ -+ -+ -+ -+ 1 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 2 -+ -+ -+ -+ -+ True -+ False -+ MLS -+ -+ -+ 0 -+ 3 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 3 -+ -+ -+ -+ -+ True -+ True -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ button5 -+ button6 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Disabled -+ -+ -+ Permissive -+ -+ -+ Enforcing -+ -+ -+ -+ -+ False -+ SELinux Administration -+ 800 -+ 500 -+ system-config-selinux.png -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ _File -+ True -+ -+ -+ True -+ False -+ -+ -+ _Add -+ True -+ False -+ True -+ image13 -+ False -+ -+ -+ -+ -+ -+ -+ _Properties -+ True -+ False -+ True -+ image14 -+ False -+ -+ -+ -+ -+ -+ -+ _Delete -+ True -+ False -+ True -+ image15 -+ False -+ -+ -+ -+ -+ -+ gtk-quit -+ True -+ False -+ True -+ True -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ True -+ False -+ _Help -+ True -+ -+ -+ True -+ False -+ -+ -+ gtk-about -+ True -+ False -+ True -+ True -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ True -+ True -+ -+ -+ True -+ False -+ 5 -+ 0 -+ none -+ -+ -+ True -+ False -+ 12 -+ -+ -+ True -+ True -+ Select Management Object -+ False -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ True -+ False -+ <b>Select:</b> -+ True -+ -+ -+ -+ -+ True -+ False -+ -+ -+ -+ -+ True -+ False -+ False -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ 5 -+ 5 -+ -+ -+ True -+ False -+ System Default Enforcing Mode -+ -+ -+ 0 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ True -+ model3 -+ -+ -+ -+ 0 -+ -+ -+ -+ -+ 1 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ Current Enforcing Mode -+ -+ -+ 0 -+ 1 -+ -+ -+ -+ -+ True -+ False -+ True -+ -+ -+ 1 -+ 1 -+ -+ -+ -+ -+ True -+ False -+ System Default Policy Type: -+ -+ -+ 0 -+ 2 -+ -+ -+ -+ -+ True -+ False -+ True -+ -+ -+ 1 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ False -+ Select if you wish to relabel then entire file system on next reboot. Relabeling can take a very long time, depending on the size of the system. If you are changing policy types or going from disabled to enforcing, a relabel is required. -+ False -+ True -+ -+ -+ True -+ False -+ True -+ 0 -+ 0 -+ -+ -+ True -+ False -+ True -+ 2 -+ -+ -+ True -+ False -+ gtk-refresh -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ Relabel on next reboot. -+ True -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ -+ -+ -+ -+ 0 -+ 3 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ end -+ 0 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ both -+ -+ -+ True -+ False -+ Revert boolean setting to system default -+ gtk-revert-to-saved -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Toggle between Customized and All Booleans -+ Customized -+ True -+ gtk-find -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ Filter -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ • -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 10 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ always -+ always -+ -+ -+ True -+ True -+ Boolean -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ 1 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ both -+ -+ -+ True -+ False -+ Add File Context -+ gtk-add -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Modify File Context -+ gtk-properties -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Delete File Context -+ gtk-delete -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Toggle between all and customized file context -+ Customized -+ True -+ gtk-find -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ Filter -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ • -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ False -+ 1 -+ -+ -+ -+ -+ True -+ True -+ always -+ always -+ -+ -+ True -+ True -+ File Labeling -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ 2 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ both -+ -+ -+ True -+ False -+ Add SELinux User Mapping -+ gtk-add -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Modify SELinux User Mapping -+ gtk-properties -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Delete SELinux User Mapping -+ gtk-delete -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ Filter -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ • -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 5 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ always -+ always -+ -+ -+ True -+ True -+ User Mapping -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ 3 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ both -+ -+ -+ True -+ False -+ Add User -+ gtk-add -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Modify User -+ gtk-properties -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Delete User -+ gtk-delete -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ Filter -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ • -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 5 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ always -+ always -+ -+ -+ True -+ True -+ SELinux User -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ 4 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ both -+ -+ -+ True -+ False -+ Add Network Port -+ gtk-add -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Edit Network Port -+ gtk-properties -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Delete Network Port -+ gtk-delete -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ -+ -+ 32 -+ True -+ False -+ vertical -+ -+ -+ -+ -+ False -+ False -+ -+ -+ -+ -+ True -+ False -+ Toggle between Customized and All Ports -+ Group View -+ True -+ gtk-indent -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Toggle between Customized and All Ports -+ Customized -+ True -+ gtk-find -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ Filter -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ • -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 5 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ always -+ always -+ -+ -+ True -+ True -+ Network Port -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ 5 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ both -+ -+ -+ True -+ False -+ Generate new policy module -+ gtk-new -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Load policy module -+ gtk-add -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Remove loadable policy module -+ gtk-remove -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ -+ -+ 10 -+ True -+ False -+ vertical -+ -+ -+ -+ -+ False -+ False -+ -+ -+ -+ -+ True -+ False -+ Enable/Disable additional audit rules, that are normally not reported in the log files. -+ Enable Audit -+ True -+ gtk-zoom-in -+ -+ -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ Filter -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ • -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 5 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ always -+ always -+ -+ -+ True -+ True -+ Policy Module -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ 6 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ both -+ -+ -+ True -+ False -+ Change process mode to permissive. -+ Permissive -+ True -+ gtk-dialog-warning -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ True -+ False -+ Change process mode to enforcing -+ Enforcing -+ True -+ gtk-dialog-error -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ Filter -+ -+ -+ False -+ False -+ 10 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ • -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ 5 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ always -+ always -+ -+ -+ True -+ True -+ Process Domain -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 2 -+ -+ -+ -+ -+ 7 -+ -+ -+ -+ -+ True -+ True -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ False -+ Add SELinux User -+ dialog -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ end -+ -+ -+ gtk-cancel -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 0 -+ -+ -+ -+ -+ gtk-ok -+ True -+ True -+ True -+ False -+ True -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ 4 -+ 6 -+ -+ -+ True -+ False -+ SELinux User -+ -+ -+ 0 -+ 0 -+ -+ -+ -+ -+ True -+ False -+ MLS/MCS Range -+ -+ -+ 0 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 1 -+ -+ -+ -+ -+ True -+ False -+ SELinux Roles -+ -+ -+ 0 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 2 -+ -+ -+ -+ -+ True -+ True -+ * -+ -+ -+ 1 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 5 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ -+ button7 -+ button8 -+ -+ -+ -+ -+ -+ -diff --git selinux-gui-2.7/usersPage.py selinux-gui-2.7/usersPage.py -index 75b0547..26794ed 100644 ---- selinux-gui-2.7/usersPage.py -+++ selinux-gui-2.7/usersPage.py -@@ -16,17 +16,13 @@ - ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - ## Author: Dan Walsh --import string --import gtk --import gtk.glade --import os --import gobject - import sys - try: - from subprocess import getstatusoutput - except ImportError: - from commands import getstatusoutput - -+from gi.repository import GObject, Gtk - import seobject - from semanagePage import * - -@@ -57,27 +53,27 @@ class usersPage(semanagePage): - def __init__(self, xml): - semanagePage.__init__(self, xml, "users", _("SELinux User")) - -- self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) -+ self.store = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING) - self.view.set_model(self.store) -- self.store.set_sort_column_id(0, gtk.SORT_ASCENDING) -+ self.store.set_sort_column_id(0, Gtk.SortType.ASCENDING) - -- col = gtk.TreeViewColumn(_("SELinux\nUser"), gtk.CellRendererText(), text=0) -+ col = Gtk.TreeViewColumn(_("SELinux\nUser"), Gtk.CellRendererText(), text=0) - col.set_sort_column_id(0) - col.set_resizable(True) - self.view.append_column(col) - -- col = gtk.TreeViewColumn(_("MLS/\nMCS Range"), gtk.CellRendererText(), text=1) -+ col = Gtk.TreeViewColumn(_("MLS/\nMCS Range"), Gtk.CellRendererText(), text=1) - col.set_resizable(True) - self.view.append_column(col) - -- col = gtk.TreeViewColumn(_("SELinux Roles"), gtk.CellRendererText(), text=2) -+ col = Gtk.TreeViewColumn(_("SELinux Roles"), Gtk.CellRendererText(), text=2) - col.set_resizable(True) - self.view.append_column(col) - - self.load() -- self.selinuxUserEntry = xml.get_widget("selinuxUserEntry") -- self.mlsRangeEntry = xml.get_widget("mlsRangeEntry") -- self.selinuxRolesEntry = xml.get_widget("selinuxRolesEntry") -+ self.selinuxUserEntry = xml.get_object("selinuxUserEntry") -+ self.mlsRangeEntry = xml.get_object("mlsRangeEntry") -+ self.selinuxRolesEntry = xml.get_object("selinuxRolesEntry") - - def load(self, filter=""): - self.filter = filter -@@ -95,10 +91,6 @@ class usersPage(semanagePage): - self.store.set_value(iter, 2, dict[k][3]) - self.view.get_selection().select_path((0,)) - -- def delete(self): -- if semanagePage.delete(self) == gtk.RESPONSE_NO: -- return None -- - def dialogInit(self): - store, iter = self.view.get_selection().get_selected() - self.selinuxUserEntry.set_text(store.get_value(iter, 0)) diff --git a/selinux-python-fedora.patch b/selinux-python-fedora.patch index 0bd9a16..b88a574 100644 --- a/selinux-python-fedora.patch +++ b/selinux-python-fedora.patch @@ -1,415 +1,7 @@ -diff --git selinux-python-2.7/audit2allow/Makefile selinux-python-2.7/audit2allow/Makefile -index 8db8075..513bb2b 100644 ---- selinux-python-2.7/audit2allow/Makefile -+++ selinux-python-2.7/audit2allow/Makefile -@@ -1,19 +1,23 @@ - PYTHON ?= python - - # Installation directories. --PREFIX ?= $(DESTDIR)/usr -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin --LIBDIR ?= $(PREFIX)/lib - MANDIR ?= $(PREFIX)/share/man --LOCALEDIR ?= /usr/share/locale --INCLUDEDIR ?= $(PREFIX)/include --LIBSEPOLA ?= $(LIBDIR)/libsepol.a - - CFLAGS ?= -Werror -Wall -W - -+# If no specific libsepol.a is specified, fall back on LDFLAGS search path -+# Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there -+# is no need to define a value for LDLIBS_LIBSEPOLA -+ifeq ($(LIBSEPOLA),) -+ LDLIBS_LIBSEPOLA := -l:libsepol.a -+endif -+ - all: audit2why sepolgen-ifgen-attr-helper - - sepolgen-ifgen-attr-helper: sepolgen-ifgen-attr-helper.o $(LIBSEPOLA) -+ $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA) - - audit2why: - ln -sf audit2allow audit2why -@@ -22,14 +26,14 @@ test: all - @$(PYTHON) test_audit2allow.py -v - - install: all -- -mkdir -p $(BINDIR) -- install -m 755 audit2allow $(BINDIR) -- (cd $(BINDIR); ln -sf audit2allow audit2why) -- install -m 755 sepolgen-ifgen-attr-helper $(BINDIR) -- install -m 755 sepolgen-ifgen $(BINDIR) -- -mkdir -p $(MANDIR)/man1 -- install -m 644 audit2allow.1 $(MANDIR)/man1/ -- install -m 644 audit2why.1 $(MANDIR)/man1/ -+ -mkdir -p $(DESTDIR)$(BINDIR) -+ install -m 755 audit2allow $(DESTDIR)$(BINDIR) -+ (cd $(DESTDIR)$(BINDIR); ln -sf audit2allow audit2why) -+ install -m 755 sepolgen-ifgen-attr-helper $(DESTDIR)$(BINDIR) -+ install -m 755 sepolgen-ifgen $(DESTDIR)$(BINDIR) -+ -mkdir -p $(DESTDIR)$(MANDIR)/man1 -+ install -m 644 audit2allow.1 $(DESTDIR)$(MANDIR)/man1/ -+ install -m 644 audit2why.1 $(DESTDIR)$(MANDIR)/man1/ - - clean: - rm -f *~ *.o sepolgen-ifgen-attr-helper -diff --git selinux-python-2.7/chcat/Makefile selinux-python-2.7/chcat/Makefile -index 0fd12d6..290b9a6 100644 ---- selinux-python-2.7/chcat/Makefile -+++ selinux-python-2.7/chcat/Makefile -@@ -1,17 +1,16 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin - MANDIR ?= $(PREFIX)/share/man --LOCALEDIR ?= $(PREFIX)/share/locale - - .PHONY: all - all: chcat - - install: all -- -mkdir -p $(BINDIR) -- install -m 755 chcat $(BINDIR) -- -mkdir -p $(MANDIR)/man8 -- install -m 644 chcat.8 $(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(BINDIR) -+ install -m 755 chcat $(DESTDIR)$(BINDIR) -+ -mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 chcat.8 $(DESTDIR)$(MANDIR)/man8/ - - clean: - -diff --git selinux-python-2.7/semanage/Makefile selinux-python-2.7/semanage/Makefile -index 132162b..5fc1998 100644 ---- selinux-python-2.7/semanage/Makefile -+++ selinux-python-2.7/semanage/Makefile -@@ -1,13 +1,12 @@ - PYTHON ?= python - - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --LIBDIR ?= $(PREFIX)/lib -+PREFIX ?= /usr - SBINDIR ?= $(PREFIX)/sbin - MANDIR = $(PREFIX)/share/man --PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(1))") --PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR) --BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions -+PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(prefix='$(PREFIX)'))") -+PACKAGEDIR ?= $(PYTHONLIBDIR) -+BASHCOMPLETIONDIR ?= $(PREFIX)/share/bash-completion/completions - - TARGETS=semanage - -@@ -16,14 +15,14 @@ BASHCOMPLETIONS=semanage-bash-completion.sh - all: $(TARGETS) - - install: all -- [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8 -- -mkdir -p $(SBINDIR) -- install -m 755 semanage $(SBINDIR) -- install -m 644 *.8 $(MANDIR)/man8 -- test -d $(PACKAGEDIR) || install -m 755 -d $(PACKAGEDIR) -- install -m 755 seobject.py $(PACKAGEDIR) -- -mkdir -p $(BASHCOMPLETIONDIR) -- install -m 644 $(BASHCOMPLETIONS) $(BASHCOMPLETIONDIR)/semanage -+ [ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 755 semanage $(DESTDIR)$(SBINDIR) -+ install -m 644 *.8 $(DESTDIR)$(MANDIR)/man8 -+ test -d $(DESTDIR)/$(PACKAGEDIR) || install -m 755 -d $(DESTDIR)/$(PACKAGEDIR) -+ install -m 755 seobject.py $(DESTDIR)/$(PACKAGEDIR) -+ -mkdir -p $(DESTDIR)$(BASHCOMPLETIONDIR) -+ install -m 644 $(BASHCOMPLETIONS) $(DESTDIR)$(BASHCOMPLETIONDIR)/semanage - - test: - @$(PYTHON) test-semanage.py -a -diff --git selinux-python-2.7/semanage/semanage selinux-python-2.7/semanage/semanage -index 313537c..8d8a086 100644 ---- selinux-python-2.7/semanage/semanage -+++ selinux-python-2.7/semanage/semanage -@@ -89,16 +89,6 @@ class CheckRole(argparse.Action): - newval.append(v) - setattr(namespace, self.dest, newval) - --store = '' -- -- --class SetStore(argparse.Action): -- -- def __call__(self, parser, namespace, values, option_string=None): -- global store -- store = values -- setattr(namespace, self.dest, values) -- - - class seParser(argparse.ArgumentParser): - -@@ -134,67 +124,21 @@ class SetImportFile(argparse.Action): - sys.exit(1) - setattr(namespace, self.dest, values) - --# functions for OBJECT initialization -- -- --def login_ini(): -- OBJECT = seobject.loginRecords(store) -- return OBJECT -- -- --def user_ini(): -- OBJECT = seobject.seluserRecords(store) -- return OBJECT -- -- --def port_ini(): -- OBJECT = seobject.portRecords(store) -- return OBJECT -- --def ibpkey_ini(): -- OBJECT = seobject.ibpkeyRecords(store) -- return OBJECT -- --def ibendport_ini(): -- OBJECT = seobject.ibendportRecords(store) -- return OBJECT -- --def module_ini(): -- OBJECT = seobject.moduleRecords(store) -- return OBJECT -- -- --def interface_ini(): -- OBJECT = seobject.interfaceRecords(store) -- return OBJECT -- -- --def node_ini(): -- OBJECT = seobject.nodeRecords(store) -- return OBJECT -- -- --def fcontext_ini(): -- OBJECT = seobject.fcontextRecords(store) -- return OBJECT -- -- --def boolean_ini(): -- OBJECT = seobject.booleanRecords(store) -- return OBJECT -- -- --def permissive_ini(): -- OBJECT = seobject.permissiveRecords(store) -- return OBJECT -- -- --def dontaudit_ini(): -- OBJECT = seobject.dontauditClass(store) -- return OBJECT -- - # define dictonary for seobject OBEJCTS --object_dict = {'login': login_ini, 'user': user_ini, 'port': port_ini, 'module': module_ini, 'interface': interface_ini, 'node': node_ini, 'fcontext': fcontext_ini, 'boolean': boolean_ini, 'permissive': permissive_ini, 'dontaudit': dontaudit_ini, 'ibpkey': ibpkey_ini, 'ibendport': ibendport_ini} -+object_dict = { -+ 'login': seobject.loginRecords, -+ 'user': seobject.seluserRecords, -+ 'port': seobject.portRecords, -+ 'module': seobject.moduleRecords, -+ 'interface': seobject.interfaceRecords, -+ 'node': seobject.nodeRecords, -+ 'fcontext': seobject.fcontextRecords, -+ 'boolean': seobject.booleanRecords, -+ 'permissive': seobject.permissiveRecords, -+ 'dontaudit': seobject.dontauditClass, -+ 'ibpkey': seobject.ibpkeyRecords, -+ 'ibendport': seobject.ibendportRecords -+} - - def generate_custom_usage(usage_text, usage_dict): - # generate custom usage from given text and dictonary -@@ -238,8 +182,7 @@ def handleLogin(args): - - handle_opts(args, login_args, args.action) - -- OBJECT = object_dict['login']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['login'](args) - - if args.action is "add": - OBJECT.add(args.login, args.seuser, args.range) -@@ -257,7 +200,7 @@ def handleLogin(args): - - - def parser_add_store(parser, name): -- parser.add_argument('-S', '--store', action=SetStore, help=_("Select an alternate SELinux Policy Store to manage")) -+ parser.add_argument('-S', '--store', default='', help=_("Select an alternate SELinux Policy Store to manage")) - - - def parser_add_priority(parser, name): -@@ -269,7 +212,7 @@ def parser_add_noheading(parser, name): - - - def parser_add_noreload(parser, name): -- parser.add_argument('-N', '--noreload', action='store_false', default=True, help=_('Do not reload policy after commit')) -+ parser.add_argument('-N', '--noreload', action='store_true', default=False, help=_('Do not reload policy after commit')) - - - def parser_add_locallist(parser, name): -@@ -372,8 +315,7 @@ def handleFcontext(args): - else: - handle_opts(args, fcontext_args, args.action) - -- OBJECT = object_dict['fcontext']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['fcontext'](args) - - if args.action is "add": - if args.equal: -@@ -441,8 +383,7 @@ def handleUser(args): - - handle_opts(args, user_args, args.action) - -- OBJECT = object_dict['user']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['user'](args) - - if args.action is "add": - OBJECT.add(args.selinux_name, args.roles, args.level, args.range, args.prefix) -@@ -492,8 +433,7 @@ def handlePort(args): - - handle_opts(args, port_args, args.action) - -- OBJECT = object_dict['port']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['port'](args) - - if args.action is "add": - OBJECT.add(args.port, args.proto, args.range, args.type) -@@ -538,8 +478,7 @@ def handlePkey(args): - - handle_opts(args, ibpkey_args, args.action) - -- OBJECT = object_dict['ibpkey']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['ibpkey'](args) - - if args.action is "add": - OBJECT.add(args.ibpkey, args.subnet_prefix, args.range, args.type) -@@ -582,8 +521,7 @@ def handleIbendport(args): - - handle_opts(args, ibendport_args, args.action) - -- OBJECT = object_dict['ibendport']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['ibendport'](args) - - if args.action is "add": - OBJECT.add(args.ibendport, args.ibdev_name, args.range, args.type) -@@ -626,8 +564,7 @@ def handleInterface(args): - - handle_opts(args, interface_args, args.action) - -- OBJECT = object_dict['interface']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['interface'](args) - - if args.action is "add": - OBJECT.add(args.interface, args.range, args.type) -@@ -666,8 +603,7 @@ def setupInterfaceParser(subparsers): - - - def handleModule(args): -- OBJECT = seobject.moduleRecords(store) -- OBJECT.set_reload(args.noreload) -+ OBJECT = seobject.moduleRecords(args) - if args.action == "add": - OBJECT.add(args.module_name, args.priority) - if args.action == "enable": -@@ -709,8 +645,7 @@ def handleNode(args): - node_args = {'list': [('node', 'type', 'proto', 'netmask'), ('')], 'add': [('locallist'), ('type', 'node', 'proto', 'netmask')], 'modify': [('locallist'), ('node', 'netmask', 'proto')], 'delete': [('locallist'), ('node', 'netmask', 'prototype')], 'extract': [('locallist', 'node', 'type', 'proto', 'netmask'), ('')], 'deleteall': [('locallist'), ('')]} - handle_opts(args, node_args, args.action) - -- OBJECT = object_dict['node']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['node'](args) - - if args.action is "add": - OBJECT.add(args.node, args.netmask, args.proto, args.range, args.type) -@@ -756,8 +691,7 @@ def handleBoolean(args): - - handle_opts(args, boolean_args, args.action) - -- OBJECT = object_dict['boolean']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['boolean'](args) - - if args.action is "modify": - if args.boolean: -@@ -795,8 +729,7 @@ def setupBooleanParser(subparsers): - - - def handlePermissive(args): -- OBJECT = object_dict['permissive']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['permissive'](args) - - if args.action is "list": - OBJECT.list(args.noheading) -@@ -830,8 +763,7 @@ def setupPermissiveParser(subparsers): - - - def handleDontaudit(args): -- OBJECT = object_dict['dontaudit']() -- OBJECT.set_reload(args.noreload) -+ OBJECT = object_dict['dontaudit'](args) - OBJECT.toggle(args.action) - - -@@ -848,7 +780,7 @@ def handleExport(args): - for i in manageditems: - print("%s -D" % i) - for i in manageditems: -- OBJECT = object_dict[i]() -+ OBJECT = object_dict[i](args) - for c in OBJECT.customized(): - print("%s %s" % (i, str(c))) - -@@ -912,7 +844,7 @@ def mkargv(line): - - - def handleImport(args): -- trans = seobject.semanageRecords(store) -+ trans = seobject.semanageRecords(args) - trans.start() - - for l in sys.stdin.readlines(): -@@ -932,7 +864,6 @@ def handleImport(args): - except KeyboardInterrupt: - sys.exit(0) - -- trans.set_reload(args.noreload) - trans.finish() - - -diff --git selinux-python-2.7/semanage/semanage-bash-completion.sh selinux-python-2.7/semanage/semanage-bash-completion.sh -index 6b53292..2d811c9 100644 ---- selinux-python-2.7/semanage/semanage-bash-completion.sh -+++ selinux-python-2.7/semanage/semanage-bash-completion.sh -@@ -59,7 +59,7 @@ __get_export_opts () { echo '$ALL_OPTS --f --output_file' ; } - __get_boolean_opts () { echo '$ALL_OPTS --on -off -1 -0' ; } - __get_user_opts () { echo '$ALL_OPTS $MANAGED_OPTS -L --level -r --range -R --role '; } - __get_login_opts () { echo '$ALL_OPTS $MANAGED_OPTS -s --seuser -r --range'; } --__get_port_opts () { echo '$ALL_OPTS $MANAGED_OPTS -t -type -r --range -p --proto'; } -+__get_port_opts () { echo '$ALL_OPTS $MANAGED_OPTS -t --type -r --range -p --proto'; } - __get_interface_opts () { echo '$ALL_OPTS $MANAGED_OPTS -t --type '; } - __get_node_opts () { echo '$ALL_OPTS $MANAGED_OPTS -t --type -M --mask -p --proto'; } - __get_fcontext_opts () { echo '$ALL_OPTS $MANAGED_OPTS -t --type -e --equal -f --ftype '; } -diff --git selinux-python-2.7/semanage/semanage.8 selinux-python-2.7/semanage/semanage.8 +diff --git selinux-python-2.8-rc1/semanage/semanage.8 selinux-python-2.8-rc1/semanage/semanage.8 index 0bdb90f..0cdcfcc 100644 ---- selinux-python-2.7/semanage/semanage.8 -+++ selinux-python-2.7/semanage/semanage.8 +--- selinux-python-2.8-rc1/semanage/semanage.8 ++++ selinux-python-2.8-rc1/semanage/semanage.8 @@ -57,9 +57,8 @@ to SELinux user identities (which controls the initial security context assigned to Linux users when they login and bounds their authorized role set) as well as security context mappings for various kinds of objects, such @@ -422,296 +14,11 @@ index 0bdb90f..0cdcfcc 100644 while the semanage user command deals with the mapping from SELinux user identities to authorized role sets. In most cases, only the former mapping needs to be adjusted by the administrator; the latter -diff --git selinux-python-2.7/semanage/seobject.py selinux-python-2.7/semanage/seobject.py -index 70fd192..045eafd 100644 ---- selinux-python-2.7/semanage/seobject.py -+++ selinux-python-2.7/semanage/seobject.py -@@ -238,20 +238,30 @@ class semanageRecords: - transaction = False - handle = None - store = None -+ args = None - -- def __init__(self, store): -+ def __init__(self, args = None): - global handle -- self.load = True -- self.sh = self.get_handle(store) -+ if args: -+ # legacy code - args was store originally -+ if type(args) == str: -+ self.store = args -+ else: -+ self.args = args -+ self.noreload = getattr(args, "noreload", False) -+ if not self.store: -+ self.store = getattr(args, "store", "") -+ -+ self.sh = self.get_handle(self.store) - - rc, localstore = selinux.selinux_getpolicytype() -- if store == "" or store == localstore: -+ if self.store == "" or self.store == localstore: - self.mylog = logger() - else: - self.mylog = nulllogger() - - def set_reload(self, load): -- self.load = load -+ self.noreload = not load - - def get_handle(self, store): - global is_mls_enabled -@@ -312,7 +322,8 @@ class semanageRecords: - if semanageRecords.transaction: - return - -- semanage_set_reload(self.sh, self.load) -+ if self.noreload: -+ semanage_set_reload(self.sh, 0) - rc = semanage_commit(self.sh) - if rc < 0: - self.mylog.commit(0) -@@ -328,8 +339,8 @@ class semanageRecords: - - class moduleRecords(semanageRecords): - -- def __init__(self, store): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def get_all(self): - l = [] -@@ -415,11 +426,6 @@ class moduleRecords(semanageRecords): - raise ValueError(_("Could not disable module %s") % m) - self.commit() - -- def modify(self, file): -- rc = semanage_module_update_file(self.sh, file) -- if rc >= 0: -- self.commit() -- - def delete(self, module, priority): - rc = semanage_set_default_priority(self.sh, priority) - if rc < 0: -@@ -440,8 +446,8 @@ class moduleRecords(semanageRecords): - - class dontauditClass(semanageRecords): - -- def __init__(self, store): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def toggle(self, dontaudit): - if dontaudit not in ["on", "off"]: -@@ -453,8 +459,8 @@ class dontauditClass(semanageRecords): - - class permissiveRecords(semanageRecords): - -- def __init__(self, store): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def get_all(self): - l = [] -@@ -522,8 +528,8 @@ class permissiveRecords(semanageRecords): - - class loginRecords(semanageRecords): - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - self.oldsename = None - self.oldserange = None - self.sename = None -@@ -534,7 +540,7 @@ class loginRecords(semanageRecords): - if sename == "": - sename = "user_u" - -- userrec = seluserRecords() -+ userrec = seluserRecords(self.args) - range, (rc, oldserole) = userrec.get(self.oldsename) - range, (rc, serole) = userrec.get(sename) - -@@ -603,7 +609,7 @@ class loginRecords(semanageRecords): - if sename == "" and serange == "": - raise ValueError(_("Requires seuser or serange")) - -- userrec = seluserRecords() -+ userrec = seluserRecords(self.args) - range, (rc, oldserole) = userrec.get(self.oldsename) - - if sename != "": -@@ -660,7 +666,7 @@ class loginRecords(semanageRecords): - - def __delete(self, name): - rec, self.oldsename, self.oldserange = selinux.getseuserbyname(name) -- userrec = seluserRecords() -+ userrec = seluserRecords(self.args) - range, (rc, oldserole) = userrec.get(self.oldsename) - - (rc, k) = semanage_seuser_key_create(self.sh, name) -@@ -779,8 +785,8 @@ class loginRecords(semanageRecords): - - class seluserRecords(semanageRecords): - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def get(self, name): - (rc, k) = semanage_user_key_create(self.sh, name) -@@ -1042,8 +1048,8 @@ class portRecords(semanageRecords): - except RuntimeError: - valid_types = [] - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def __genkey(self, port, proto): - if proto == "tcp": -@@ -1317,8 +1323,8 @@ class ibpkeyRecords(semanageRecords): - except: - valid_types = [] - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def __genkey(self, pkey, subnet_prefix): - if subnet_prefix == "": -@@ -1540,9 +1546,8 @@ class ibpkeyRecords(semanageRecords): - def customized(self): - l = [] - ddict = self.get_all(True) -- keys = ddict.keys() -- keys.sort() -- for k in keys: -+ -+ for k in sorted(ddict.keys()): - if k[0] == k[1]: - l.append("-a -t %s -x %s %s" % (ddict[k][0], k[2], k[0])) - else: -@@ -1554,11 +1559,10 @@ class ibpkeyRecords(semanageRecords): - keys = ddict.keys() - if len(keys) == 0: - return -- keys.sort() - - if heading: - print("%-30s %-18s %s\n" % (_("SELinux IB Pkey Type"), _("Subnet_Prefix"), _("Pkey Number"))) -- for i in keys: -+ for i in sorted(keys): - rec = "%-30s %-18s " % i - rec += "%s" % ddict[i][0] - for p in ddict[i][1:]: -@@ -1572,8 +1576,8 @@ class ibendportRecords(semanageRecords): - except: - valid_types = [] - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def __genkey(self, ibendport, ibdev_name): - if ibdev_name == "": -@@ -1782,10 +1786,9 @@ class ibendportRecords(semanageRecords): - def customized(self): - l = [] - ddict = self.get_all(True) -- keys = ddict.keys() -- keys.sort() -- for k in keys: -- l.append("-a -t %s -x %s %s" % (ddict[k][0], k[2], k[0])) -+ -+ for k in sorted(ddict.keys()): -+ l.append("-a -t %s -r %s -z %s %s" % (ddict[k][0], ddict[k][1], k[1], k[0])) - return l - - def list(self, heading=1, locallist=0): -@@ -1793,11 +1796,10 @@ class ibendportRecords(semanageRecords): - keys = ddict.keys() - if len(keys) == 0: - return -- keys.sort() - - if heading: - print("%-30s %-18s %s\n" % (_("SELinux IB End Port Type"), _("IB Device Name"), _("Port Number"))) -- for i in keys: -+ for i in sorted(keys): - rec = "%-30s %-18s " % i - rec += "%s" % ddict[i][0] - for p in ddict[i][1:]: -@@ -1810,8 +1812,8 @@ class nodeRecords(semanageRecords): - except RuntimeError: - valid_types = [] - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - self.protocol = ["ipv4", "ipv6"] - - def validate(self, addr, mask, protocol): -@@ -2046,8 +2048,8 @@ class nodeRecords(semanageRecords): - - class interfaceRecords(semanageRecords): - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - - def __add(self, interface, serange, ctype): - if is_mls_enabled == 1: -@@ -2243,8 +2245,8 @@ class fcontextRecords(semanageRecords): - except RuntimeError: - valid_types = [] - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - self.equiv = {} - self.equiv_dist = {} - self.equal_ind = False -@@ -2566,10 +2568,15 @@ class fcontextRecords(semanageRecords): - if rc < 0: - raise ValueError(_("Could not list file contexts")) - -+ (rc, fchomedirs) = semanage_fcontext_list_homedirs(self.sh) -+ if rc < 0: -+ raise ValueError(_("Could not list file contexts for home directories")) -+ - (rc, fclocal) = semanage_fcontext_list_local(self.sh) - if rc < 0: - raise ValueError(_("Could not list local file contexts")) - -+ self.flist += fchomedirs - self.flist += fclocal - - ddict = {} -@@ -2627,8 +2634,8 @@ class fcontextRecords(semanageRecords): - - class booleanRecords(semanageRecords): - -- def __init__(self, store=""): -- semanageRecords.__init__(self, store) -+ def __init__(self, args = None): -+ semanageRecords.__init__(self, args) - self.dict = {} - self.dict["TRUE"] = 1 - self.dict["FALSE"] = 0 -@@ -2644,7 +2651,7 @@ class booleanRecords(semanageRecords): +diff --git selinux-python-2.8-rc1/semanage/seobject.py selinux-python-2.8-rc1/semanage/seobject.py +index ac310ea..045eafd 100644 +--- selinux-python-2.8-rc1/semanage/seobject.py ++++ selinux-python-2.8-rc1/semanage/seobject.py +@@ -2651,7 +2651,7 @@ class booleanRecords(semanageRecords): self.current_booleans = [] ptype = None @@ -720,254 +27,11 @@ index 70fd192..045eafd 100644 self.modify_local = True else: self.modify_local = False -diff --git selinux-python-2.7/sepolgen/src/sepolgen/Makefile selinux-python-2.7/sepolgen/src/sepolgen/Makefile -index d3aa771..c75809a 100644 ---- selinux-python-2.7/sepolgen/src/sepolgen/Makefile -+++ selinux-python-2.7/sepolgen/src/sepolgen/Makefile -@@ -1,12 +1,13 @@ -+PREFIX ?= /usr - PYTHON ?= python --PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(1))") --PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR)/sepolgen -+PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(prefix='$(PREFIX)'))") -+PACKAGEDIR ?= /$(PYTHONLIBDIR)/sepolgen - - all: - - install: all -- -mkdir -p $(PACKAGEDIR) -- install -m 644 *.py $(PACKAGEDIR) -+ -mkdir -p $(DESTDIR)$(PACKAGEDIR) -+ install -m 644 *.py $(DESTDIR)$(PACKAGEDIR) - - clean: - rm -f parser.out parsetab.py -diff --git selinux-python-2.7/sepolgen/src/sepolgen/policygen.py selinux-python-2.7/sepolgen/src/sepolgen/policygen.py -index 34c8401..ee664fb 100644 ---- selinux-python-2.7/sepolgen/src/sepolgen/policygen.py -+++ selinux-python-2.7/sepolgen/src/sepolgen/policygen.py -@@ -77,7 +77,7 @@ class PolicyGenerator: - self.explain = NO_EXPLANATION - self.gen_requires = False - if module: -- self.moduel = module -+ self.module = module - else: - self.module = refpolicy.Module() - -diff --git selinux-python-2.7/sepolgen/src/share/Makefile selinux-python-2.7/sepolgen/src/share/Makefile -index abf5e45..1a7133c 100644 ---- selinux-python-2.7/sepolgen/src/share/Makefile -+++ selinux-python-2.7/sepolgen/src/share/Makefile -@@ -1,10 +1,10 @@ --SHAREDIR ?= $(DESTDIR)/var/lib/sepolgen -+SHAREDIR ?= /var/lib/sepolgen - - all: - - install: all -- -mkdir -p $(SHAREDIR) -- install -m 644 perm_map $(SHAREDIR) -+ -mkdir -p $(DESTDIR)$(SHAREDIR) -+ install -m 644 perm_map $(DESTDIR)$(SHAREDIR) - - clean: -- rm -f *~ -\ No newline at end of file -+ rm -f *~ -diff --git selinux-python-2.7/sepolicy/Makefile selinux-python-2.7/sepolicy/Makefile -index 5a56e6c..fb8a132 100644 ---- selinux-python-2.7/sepolicy/Makefile -+++ selinux-python-2.7/sepolicy/Makefile -@@ -1,14 +1,10 @@ - PYTHON ?= python - - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --LIBDIR ?= $(PREFIX)/lib -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin --DATADIR ?= $(PREFIX)/share - MANDIR ?= $(PREFIX)/share/man --LOCALEDIR ?= /usr/share/locale --BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions --SHAREDIR ?= $(PREFIX)/share/sandbox -+BASHCOMPLETIONDIR ?= $(PREFIX)/share/bash-completion/completions - CFLAGS ?= -Wall -Werror -Wextra -W - override CFLAGS += -DPACKAGE="policycoreutils" -DSHARED -shared - -@@ -30,13 +26,13 @@ test: - @$(PYTHON) test_sepolicy.py -v - - install: -- $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` -- [ -d $(BINDIR) ] || mkdir -p $(BINDIR) -- install -m 755 sepolicy.py $(BINDIR)/sepolicy -- (cd $(BINDIR); ln -sf sepolicy sepolgen) -- -mkdir -p $(MANDIR)/man8 -- install -m 644 *.8 $(MANDIR)/man8 -- -mkdir -p $(BASHCOMPLETIONDIR) -- install -m 644 $(BASHCOMPLETIONS) $(BASHCOMPLETIONDIR)/sepolicy -+ $(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` -+ [ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) -+ install -m 755 sepolicy.py $(DESTDIR)$(BINDIR)/sepolicy -+ (cd $(DESTDIR)$(BINDIR); ln -sf sepolicy sepolgen) -+ -mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 *.8 $(DESTDIR)$(MANDIR)/man8 -+ -mkdir -p $(DESTDIR)$(BASHCOMPLETIONDIR) -+ install -m 644 $(BASHCOMPLETIONS) $(DESTDIR)$(BASHCOMPLETIONDIR)/sepolicy - - relabel: -diff --git selinux-python-2.7/sepolicy/sepolicy.8 selinux-python-2.7/sepolicy/sepolicy.8 -index 7900586..09d2b24 100644 ---- selinux-python-2.7/sepolicy/sepolicy.8 -+++ selinux-python-2.7/sepolicy/sepolicy.8 -@@ -22,14 +22,15 @@ Query SELinux policy to see if domains can communicate with each other - .br - - .B generate --.br - .br - Generate SELinux Policy module template --.B gui -+.B sepolicy-generate(8) - .br -+ -+.B gui - .br - Launch Graphical User Interface for SELinux Policy, requires policycoreutils-gui package. --.B sepolicy-generate(8) -+.B sepolicy-gui(8) - .br - - .B interface -diff --git selinux-python-2.7/sepolicy/sepolicy/__init__.py selinux-python-2.7/sepolicy/sepolicy/__init__.py -index 5cfc071..24e3526 100644 ---- selinux-python-2.7/sepolicy/sepolicy/__init__.py -+++ selinux-python-2.7/sepolicy/sepolicy/__init__.py -@@ -4,6 +4,7 @@ - # Author: Ryan Hallisey - # Author: Jason Zaman - -+import errno - import selinux - import setools - import glob -@@ -207,10 +208,17 @@ def info(setype, name=None): - elif len(ports) == 1: - q.ports = (ports[0], ports[0]) - -+ if _pol.mls: -+ return ({ -+ 'high': x.ports.high, -+ 'protocol': str(x.protocol), -+ 'range': str(x.context.range_), -+ 'type': str(x.context.type_), -+ 'low': x.ports.low, -+ } for x in q.results()) - return ({ - 'high': x.ports.high, - 'protocol': str(x.protocol), -- 'range': str(x.context.range_), - 'type': str(x.context.type_), - 'low': x.ports.low, - } for x in q.results()) -@@ -220,11 +228,16 @@ def info(setype, name=None): - if name: - q.name = name - -+ if _pol.mls: -+ return ({ -+ 'range': str(x.mls_range), -+ 'name': str(x), -+ 'roles': list(map(str, x.roles)), -+ 'level': str(x.mls_level), -+ } for x in q.results()) - return ({ -- 'range': str(x.mls_range), - 'name': str(x), - 'roles': list(map(str, x.roles)), -- 'level': str(x.mls_level), - } for x in q.results()) - - elif setype == BOOLEAN: -@@ -511,12 +524,15 @@ def find_entrypoint_path(exe, exclude_list=[]): - - - def read_file_equiv(edict, fc_path, modify): -- fd = open(fc_path, "r") -- fc = fd.readlines() -- fd.close() -- for e in fc: -- f = e.split() -- edict[f[0]] = {"equiv": f[1], "modify": modify} -+ try: -+ with open(fc_path, "r") as fd: -+ for e in fd: -+ f = e.split() -+ if f and not f[0].startswith('#'): -+ edict[f[0]] = {"equiv": f[1], "modify": modify} -+ except OSError as e: -+ if e.errno != errno.ENOENT: -+ raise - return edict - - -@@ -543,9 +559,13 @@ def get_local_file_paths(fc_path=selinux.selinux_file_context_path()): - if local_files: - return local_files - local_files = [] -- fd = open(fc_path + ".local", "r") -- fc = fd.readlines() -- fd.close() -+ try: -+ with open(fc_path + ".local", "r") as fd: -+ fc = fd.readlines() -+ except OSError as e: -+ if e.errno != errno.ENOENT: -+ raise -+ return [] - for i in fc: - rec = i.split() - if len(rec) == 0: -@@ -573,9 +593,12 @@ def get_fcdict(fc_path=selinux.selinux_file_context_path()): - fc += fd.readlines() - fd.close() - fcdict = {} -- fd = open(fc_path + ".local", "r") -- fc += fd.readlines() -- fd.close() -+ try: -+ with open(fc_path + ".local", "r") as fd: -+ fc += fd.readlines() -+ except OSError as e: -+ if e.errno != errno.ENOENT: -+ raise - - for i in fc: - rec = i.split() -@@ -856,8 +879,9 @@ def get_selinux_users(): - global selinux_user_list - if not selinux_user_list: - selinux_user_list = list(info(USER)) -- for x in selinux_user_list: -- x['range'] = "".join(x['range'].split(" ")) -+ if _pol.mls: -+ for x in selinux_user_list: -+ x['range'] = "".join(x['range'].split(" ")) - return selinux_user_list - - -@@ -955,7 +979,7 @@ def get_description(f, markup=markup): - if f.endswith("_db_t"): - return txt + "treat the files as %s database content." % prettyprint(f, "_db_t") - if f.endswith("_ra_content_t"): -- return txt + "treat the files as %s read/append content." % prettyprint(f, "_ra_conten_t") -+ return txt + "treat the files as %s read/append content." % prettyprint(f, "_ra_content_t") - if f.endswith("_cert_t"): - return txt + "treat the files as %s certificate data." % prettyprint(f, "_cert_t") - if f.endswith("_key_t"): -@@ -1136,27 +1160,14 @@ def boolean_desc(boolean): +diff --git selinux-python-2.8-rc1/sepolicy/sepolicy/__init__.py selinux-python-2.8-rc1/sepolicy/sepolicy/__init__.py +index 89346ab..24e3526 100644 +--- selinux-python-2.8-rc1/sepolicy/sepolicy/__init__.py ++++ selinux-python-2.8-rc1/sepolicy/sepolicy/__init__.py +@@ -1160,27 +1160,14 @@ def boolean_desc(boolean): def get_os_version(): @@ -1001,253 +65,11 @@ index 5cfc071..24e3526 100644 def reinit(): -diff --git selinux-python-2.7/sepolicy/sepolicy/generate.py selinux-python-2.7/sepolicy/sepolicy/generate.py -index d68f96e..f814e27 100644 ---- selinux-python-2.7/sepolicy/sepolicy/generate.py -+++ selinux-python-2.7/sepolicy/sepolicy/generate.py -@@ -105,12 +105,12 @@ def get_all_ports(): - p['type'] == "port_t" or \ - p['type'] == "hi_reserved_port_t": - continue -- dict[(p['low'], p['high'], p['protocol'])] = (p['type'], p['range']) -+ dict[(p['low'], p['high'], p['protocol'])] = (p['type'], p.get('range')) - return dict - - - def get_all_users(): -- users = map(lambda x: x['name'], sepolicy.info(sepolicy.USER)) -+ users = [x['name'] for x in sepolicy.info(sepolicy.USER)] - users.remove("system_u") - users.remove("root") - users.sort() -@@ -191,14 +191,14 @@ def verify_ports(ports): - temp.append(p) - return temp - except ValueError: -- raise ValueError(_("Ports must be numbers or ranges of numbers from 1 to %d " % max_port)) -+ raise ValueError(_("Ports must be numbers or ranges of numbers from 1 to %d ") % max_port) - - - class policy: - - def __init__(self, name, type): - self.rpms = [] -- self.ports = [] -+ self.ports = {} - self.all_roles = get_all_roles() - self.types = [] - -@@ -459,25 +459,25 @@ class policy: - self.out_udp = [all, False, False, verify_ports(ports)] - - def set_use_resolve(self, val): -- if not isinstance(val, types.BooleanType): -+ if type(val) is not bool: - raise ValueError(_("use_resolve must be a boolean value ")) - - self.use_resolve = val - - def set_use_syslog(self, val): -- if not isinstance(val, types.BooleanType): -+ if type(val) is not bool: - raise ValueError(_("use_syslog must be a boolean value ")) - - self.use_syslog = val - - def set_use_kerberos(self, val): -- if not isinstance(val, types.BooleanType): -+ if type(val) is not bool: - raise ValueError(_("use_kerberos must be a boolean value ")) - - self.use_kerberos = val - - def set_manage_krb5_rcache(self, val): -- if not isinstance(val, types.BooleanType): -+ if type(val) is not bool: - raise ValueError(_("manage_krb5_rcache must be a boolean value ")) - - self.manage_krb5_rcache = val -diff --git selinux-python-2.7/sepolicy/sepolicy/gui.py selinux-python-2.7/sepolicy/sepolicy/gui.py -index 007c94a..537d516 100644 ---- selinux-python-2.7/sepolicy/sepolicy/gui.py -+++ selinux-python-2.7/sepolicy/sepolicy/gui.py -@@ -500,7 +500,7 @@ class SELinuxGui(): - self.all_domains.sort(key=str.lower) - - if app and app not in self.all_domains: -- self.error(_("%s is not a valid domain" % app)) -+ self.error(_("%s is not a valid domain") % app) - self.quit() - - loading_gui.show() -@@ -907,8 +907,8 @@ class SELinuxGui(): - if "object_r" in roles: - roles.remove("object_r") - self.user_liststore.set_value(iter, 1, ", ".join(roles)) -- self.user_liststore.set_value(iter, 2, u["level"]) -- self.user_liststore.set_value(iter, 3, u["range"]) -+ self.user_liststore.set_value(iter, 2, u.get("level", "")) -+ self.user_liststore.set_value(iter, 3, u.get("range", "")) - self.user_liststore.set_value(iter, 4, True) - self.ready_mouse() - -@@ -1056,21 +1056,21 @@ class SELinuxGui(): - self.application_files_initialize(app) - self.transitions_files_initialize(app) - -- self.executable_files_tab.set_tooltip_text(_("File path used to enter the '%s' domain." % app)) -- self.writable_files_tab.set_tooltip_text(_("Files to which the '%s' domain can write." % app)) -- self.network_out_tab.set_tooltip_text(_("Network Ports to which the '%s' is allowed to connect." % app)) -- self.network_in_tab.set_tooltip_text(_("Network Ports to which the '%s' is allowed to listen." % app)) -- self.application_files_tab.set_tooltip_text(_("File Types defined for the '%s'." % app)) -- self.boolean_radio_button.set_tooltip_text(_("Display boolean information that can be used to modify the policy for the '%s'." % app)) -- self.files_radio_button.set_tooltip_text(_("Display file type information that can be used by the '%s'." % app)) -- self.network_radio_button.set_tooltip_text(_("Display network ports to which the '%s' can connect or listen to." % app)) -- self.transitions_into_tab.set_label(_("Application Transitions Into '%s'" % app)) -- self.transitions_from_tab.set_label(_("Application Transitions From '%s'" % app)) -- self.transitions_file_tab.set_label(_("File Transitions From '%s'" % app)) -+ self.executable_files_tab.set_tooltip_text(_("File path used to enter the '%s' domain.") % app) -+ self.writable_files_tab.set_tooltip_text(_("Files to which the '%s' domain can write.") % app) -+ self.network_out_tab.set_tooltip_text(_("Network Ports to which the '%s' is allowed to connect.") % app) -+ self.network_in_tab.set_tooltip_text(_("Network Ports to which the '%s' is allowed to listen.") % app) -+ self.application_files_tab.set_tooltip_text(_("File Types defined for the '%s'.") % app) -+ self.boolean_radio_button.set_tooltip_text(_("Display boolean information that can be used to modify the policy for the '%s'.") % app) -+ self.files_radio_button.set_tooltip_text(_("Display file type information that can be used by the '%s'.") % app) -+ self.network_radio_button.set_tooltip_text(_("Display network ports to which the '%s' can connect or listen to.") % app) -+ self.transitions_into_tab.set_label(_("Application Transitions Into '%s'") % app) -+ self.transitions_from_tab.set_label(_("Application Transitions From '%s'") % app) -+ self.transitions_file_tab.set_label(_("File Transitions From '%s'") % app) - self.transitions_into_tab.set_tooltip_text(_("Executables which will transition to '%s', when executing selected domains entrypoint.") % app) - self.transitions_from_tab.set_tooltip_text(_("Executables which will transition to a different domain, when '%s' executes them.") % app) -- self.transitions_file_tab.set_tooltip_text(_("Files by '%s' with transitions to a different label." % app)) -- self.transitions_radio_button.set_tooltip_text(_("Display applications that can transition into or out of the '%s'." % app)) -+ self.transitions_file_tab.set_tooltip_text(_("Files by '%s' with transitions to a different label.") % app) -+ self.transitions_radio_button.set_tooltip_text(_("Display applications that can transition into or out of the '%s'.") % app) - - self.application = app - self.applications_selection_button.set_label(self.application) -@@ -1755,14 +1755,14 @@ class SELinuxGui(): - if self.login_mls_entry.get_text() == "": - for u in sepolicy.get_selinux_users(): - if seuser == u['name']: -- self.login_mls_entry.set_text(u['range']) -+ self.login_mls_entry.set_text(u.get('range', '')) - - def user_roles_combobox_change(self, combo, *args): - serole = self.combo_get_active_text(combo) - if self.user_mls_entry.get_text() == "": - for u in sepolicy.get_all_roles(): - if serole == u['name']: -- self.user_mls_entry.set_text(u['range']) -+ self.user_mls_entry.set_text(u.get('range', '')) - - def get_selected_iter(self): - iter = None -@@ -1973,7 +1973,10 @@ class SELinuxGui(): - self.cur_dict["user"][name] = {"action": "-m", "range": mls_range, "level": level, "role": roles, "oldrange": oldrange, "oldlevel": oldlevel, "oldroles": oldroles, "oldname": oldname} - else: - iter = self.liststore.append(None) -- self.cur_dict["user"][name] = {"action": "-a", "range": mls_range, "level": level, "role": roles} -+ if mls_range or level: -+ self.cur_dict["user"][name] = {"action": "-a", "range": mls_range, "level": level, "role": roles} -+ else: -+ self.cur_dict["user"][name] = {"action": "-a", "role": roles} - - self.liststore.set_value(iter, 0, name) - self.liststore.set_value(iter, 1, roles) -@@ -2089,8 +2092,8 @@ class SELinuxGui(): - user_dict = self.cust_dict["user"] - for user in user_dict: - roles = user_dict[user]["role"] -- mls = user_dict[user]["range"] -- level = user_dict[user]["level"] -+ mls = user_dict[user].get("range", "") -+ level = user_dict[user].get("level", "") - iter = self.user_delete_liststore.append() - self.user_delete_liststore.set_value(iter, 1, user) - self.user_delete_liststore.set_value(iter, 2, roles) -@@ -2104,7 +2107,7 @@ class SELinuxGui(): - login_dict = self.cust_dict["login"] - for login in login_dict: - seuser = login_dict[login]["seuser"] -- mls = login_dict[login]["range"] -+ mls = login_dict[login].get("range", "") - iter = self.login_delete_liststore.append() - self.login_delete_liststore.set_value(iter, 1, seuser) - self.login_delete_liststore.set_value(iter, 2, login) -@@ -2268,7 +2271,7 @@ class SELinuxGui(): - self.update_treestore.set_value(niter, 3, False) - roles = self.cur_dict["user"][user]["role"] - self.update_treestore.set_value(niter, 1, (_("Roles: %s")) % roles) -- mls = self.cur_dict["user"][user]["range"] -+ mls = self.cur_dict["user"][user].get("range", "") - niter = self.update_treestore.append(iter) - self.update_treestore.set_value(niter, 3, False) - self.update_treestore.set_value(niter, 1, _("MLS/MCS Range: %s") % mls) -@@ -2293,7 +2296,7 @@ class SELinuxGui(): - self.update_treestore.set_value(niter, 3, False) - seuser = self.cur_dict["login"][login]["seuser"] - self.update_treestore.set_value(niter, 1, (_("SELinux User: %s")) % seuser) -- mls = self.cur_dict["login"][login]["range"] -+ mls = self.cur_dict["login"][login].get("range", "") - niter = self.update_treestore.append(iter) - self.update_treestore.set_value(niter, 3, False) - self.update_treestore.set_value(niter, 1, _("MLS/MCS Range: %s") % mls) -@@ -2487,14 +2490,18 @@ class SELinuxGui(): - for l in self.cur_dict[k]: - if self.cur_dict[k][l]["action"] == "-d": - update_buffer += "login -d %s\n" % l -- else: -+ elif "range" in self.cur_dict[k][l]: - update_buffer += "login %s -s %s -r %s %s\n" % (self.cur_dict[k][l]["action"], self.cur_dict[k][l]["seuser"], self.cur_dict[k][l]["range"], l) -+ else: -+ update_buffer += "login %s -s %s %s\n" % (self.cur_dict[k][l]["action"], self.cur_dict[k][l]["seuser"], l) - if k in "user": - for u in self.cur_dict[k]: - if self.cur_dict[k][u]["action"] == "-d": - update_buffer += "user -d %s\n" % u -- else: -+ elif "level" in self.cur_dict[k][u] and "range" in self.cur_dict[k][u]: - update_buffer += "user %s -L %s -r %s -R %s %s\n" % (self.cur_dict[k][u]["action"], self.cur_dict[k][u]["level"], self.cur_dict[k][u]["range"], self.cur_dict[k][u]["role"], u) -+ else: -+ update_buffer += "user %s -R %s %s\n" % (self.cur_dict[k][u]["action"], self.cur_dict[k][u]["role"], u) - - if k in "fcontext-equiv": - for f in self.cur_dict[k]: -diff --git selinux-python-2.7/sepolicy/sepolicy/interface.py selinux-python-2.7/sepolicy/sepolicy/interface.py -index c64122e..18374dc 100644 ---- selinux-python-2.7/sepolicy/sepolicy/interface.py -+++ selinux-python-2.7/sepolicy/sepolicy/interface.py -@@ -220,7 +220,7 @@ def interface_compile_test(interface, path="/usr/share/selinux/devel/policy.xml" - idict = get_interface_dict(path) - - if not (interface.split("_")[0] in exclude_interfaces or idict[interface][2] in exclude_interface_type): -- print(_("Compiling %s interface" % interface)) -+ print(_("Compiling %s interface") % interface) - try: - fd = open(policy_files['te'], "w") - fd.write(generate_compile_te(interface, idict)) -@@ -237,4 +237,4 @@ def interface_compile_test(interface, path="/usr/share/selinux/devel/policy.xml" - os.remove(v) - - else: -- sys.stderr.write(_("\nCompiling of %s interface is not supported." % interface)) -+ sys.stderr.write(_("\nCompiling of %s interface is not supported.") % interface) -diff --git selinux-python-2.7/sepolicy/sepolicy/manpage.py selinux-python-2.7/sepolicy/sepolicy/manpage.py -index 4d84636..8121e5c 100755 ---- selinux-python-2.7/sepolicy/sepolicy/manpage.py -+++ selinux-python-2.7/sepolicy/sepolicy/manpage.py -@@ -84,7 +84,8 @@ def get_all_users_info(): - - for d in allusers_info: - allusers.append(d['name']) -- users_range[d['name'].split("_")[0]] = d['range'] -+ if 'range' in d: -+ users_range[d['name'].split("_")[0]] = d['range'] - - for u in allusers: - if u not in ["system_u", "root", "unconfined_u"]: -@@ -125,8 +126,33 @@ def gen_domains(): +diff --git selinux-python-2.8-rc1/sepolicy/sepolicy/manpage.py selinux-python-2.8-rc1/sepolicy/sepolicy/manpage.py +index ed8cb71..8121e5c 100755 +--- selinux-python-2.8-rc1/sepolicy/sepolicy/manpage.py ++++ selinux-python-2.8-rc1/sepolicy/sepolicy/manpage.py +@@ -126,8 +126,33 @@ def gen_domains(): domains.sort() return domains @@ -1282,7 +104,7 @@ index 4d84636..8121e5c 100755 def _gen_types(): global types -@@ -149,10 +175,6 @@ def prettyprint(f, trim): +@@ -150,10 +175,6 @@ def prettyprint(f, trim): manpage_domains = [] manpage_roles = [] @@ -1293,7 +115,7 @@ index 4d84636..8121e5c 100755 def get_alphabet_manpages(manpage_list): alphabet_manpages = dict.fromkeys(string.ascii_letters, []) for i in string.ascii_letters: -@@ -182,7 +204,7 @@ def convert_manpage_to_html(html_manpage, manpage): +@@ -183,7 +204,7 @@ def convert_manpage_to_html(html_manpage, manpage): class HTMLManPages: """ @@ -1302,19 +124,19 @@ index 4d84636..8121e5c 100755 """ def __init__(self, manpage_roles, manpage_domains, path, os_version): -@@ -190,9 +212,9 @@ class HTMLManPages: +@@ -191,9 +212,9 @@ class HTMLManPages: self.manpage_domains = get_alphabet_manpages(manpage_domains) self.os_version = os_version self.old_path = path + "/" - self.new_path = self.old_path + self.os_version + "/" + self.new_path = self.old_path -- if self.os_version in fedora_releases or rhel_releases: +- if self.os_version in fedora_releases or self.os_version in rhel_releases: + if self.os_version: self.__gen_html_manpages() else: print("SELinux HTML man pages can not be generated for this %s" % os_version) -@@ -201,7 +223,6 @@ class HTMLManPages: +@@ -202,7 +223,6 @@ class HTMLManPages: def __gen_html_manpages(self): self._write_html_manpage() self._gen_index() @@ -1322,7 +144,7 @@ index 4d84636..8121e5c 100755 self._gen_css() def _write_html_manpage(self): -@@ -219,67 +240,21 @@ class HTMLManPages: +@@ -220,67 +240,21 @@ class HTMLManPages: convert_manpage_to_html((self.new_path + r.rsplit("_selinux", 1)[0] + ".html"), self.old_path + r) def _gen_index(self): @@ -1369,7 +191,7 @@ index 4d84636..8121e5c 100755 - - """) - fd.close() -- print("%s has been created") % index +- print("%s has been created" % index) - - def _gen_body(self): html = self.new_path + self.os_version + ".html" @@ -1394,7 +216,7 @@ index 4d84636..8121e5c 100755 for letter in self.manpage_roles: if len(self.manpage_roles[letter]): fd.write(""" -@@ -423,6 +398,9 @@ class ManPage: +@@ -424,6 +398,9 @@ class ManPage: self.all_file_types = sepolicy.get_all_file_types() self.role_allows = sepolicy.get_all_role_allows() self.types = _gen_types() @@ -1404,7 +226,7 @@ index 4d84636..8121e5c 100755 if self.source_files: self.fcpath = self.root + "file_contexts" -@@ -735,10 +713,13 @@ Default Defined Ports:""") +@@ -736,10 +713,13 @@ Default Defined Ports:""") def _file_context(self): flist = [] @@ -1418,7 +240,7 @@ index 4d84636..8121e5c 100755 if f in self.fcdict: mpaths = mpaths + self.fcdict[f]["regex"] if len(mpaths) == 0: -@@ -790,19 +771,20 @@ SELinux %(domainname)s policy is very flexible allowing users to setup their %(d +@@ -791,19 +771,20 @@ SELinux %(domainname)s policy is very flexible allowing users to setup their %(d .PP """ % {'domainname': self.domainname, 'equiv': e, 'alt': e.split('/')[-1]}) @@ -1442,21 +264,14 @@ index 4d84636..8121e5c 100755 self.fd.write(r""" .I The following file types are defined for %(domainname)s: -@@ -921,8 +903,7 @@ This manual page was auto-generated using - .B "sepolicy manpage". - - .SH "SEE ALSO" --selinux(8), %s(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) --""" % (self.domainname)) -+selinux(8), %s(8), semanage(8), restorecon(8), chcon(1), sepolicy(8)""" % (self.domainname)) - - if self.booltext != "": - self.fd.write(", setsebool(8)") -@@ -974,8 +955,7 @@ All executeables with the default executable label, usually stored in /usr/bin a +@@ -974,11 +955,7 @@ All executeables with the default executable label, usually stored in /usr/bin a %s""" % ", ".join(paths)) def _mcs_types(self): -- mcs_constrained_type = next(sepolicy.info(sepolicy.ATTRIBUTE, "mcs_constrained_type")) +- try: +- mcs_constrained_type = next(sepolicy.info(sepolicy.ATTRIBUTE, "mcs_constrained_type")) +- except StopIteration: +- return - if self.type not in mcs_constrained_type['types']: + if self.type not in self.mcs_constrained_types['types']: return diff --git a/selinux-sandbox-fedora.patch b/selinux-sandbox-fedora.patch index 6296834..39ca954 100644 --- a/selinux-sandbox-fedora.patch +++ b/selinux-sandbox-fedora.patch @@ -1,62 +1,7 @@ -diff --git selinux-sandbox-2.7/Makefile selinux-sandbox-2.7/Makefile -index 05c3d65..49c1d3f 100644 ---- selinux-sandbox-2.7/Makefile -+++ selinux-sandbox-2.7/Makefile -@@ -1,13 +1,11 @@ - PYTHON ?= python - - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig --LIBDIR ?= $(PREFIX)/lib -+PREFIX ?= /usr -+SYSCONFDIR ?= /etc/sysconfig - BINDIR ?= $(PREFIX)/bin - SBINDIR ?= $(PREFIX)/sbin - MANDIR ?= $(PREFIX)/share/man --LOCALEDIR ?= /usr/share/locale - SHAREDIR ?= $(PREFIX)/share/sandbox - override CFLAGS += -DPACKAGE="\"policycoreutils\"" -Wall -Werror -Wextra -W - override LDLIBS += -lselinux -lcap-ng -@@ -18,20 +16,20 @@ all: sandbox seunshare sandboxX.sh start - seunshare: $(SEUNSHARE_OBJS) - - install: all -- -mkdir -p $(BINDIR) -- install -m 755 sandbox $(BINDIR) -- -mkdir -p $(MANDIR)/man8 -- install -m 644 sandbox.8 $(MANDIR)/man8/ -- install -m 644 seunshare.8 $(MANDIR)/man8/ -- -mkdir -p $(MANDIR)/man5 -- install -m 644 sandbox.5 $(MANDIR)/man5/ -- -mkdir -p $(SBINDIR) -- install -m 4755 seunshare $(SBINDIR)/ -- -mkdir -p $(SHAREDIR) -- install -m 755 sandboxX.sh $(SHAREDIR) -- install -m 755 start $(SHAREDIR) -- -mkdir -p $(SYSCONFDIR) -- install -m 644 sandbox.conf $(SYSCONFDIR)/sandbox -+ -mkdir -p $(DESTDIR)$(BINDIR) -+ install -m 755 sandbox $(DESTDIR)$(BINDIR) -+ -mkdir -p $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 sandbox.8 $(DESTDIR)$(MANDIR)/man8/ -+ install -m 644 seunshare.8 $(DESTDIR)$(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(MANDIR)/man5 -+ install -m 644 sandbox.5 $(DESTDIR)$(MANDIR)/man5/ -+ -mkdir -p $(DESTDIR)$(SBINDIR) -+ install -m 4755 seunshare $(DESTDIR)$(SBINDIR)/ -+ -mkdir -p $(DESTDIR)$(SHAREDIR) -+ install -m 755 sandboxX.sh $(DESTDIR)$(SHAREDIR) -+ install -m 755 start $(DESTDIR)$(SHAREDIR) -+ -mkdir -p $(DESTDIR)$(SYSCONFDIR) -+ install -m 644 sandbox.conf $(DESTDIR)$(SYSCONFDIR)/sandbox - - test: - @$(PYTHON) test_sandbox.py -v -diff --git selinux-sandbox-2.7/sandboxX.sh selinux-sandbox-2.7/sandboxX.sh +diff --git selinux-sandbox-2.8-rc1/sandboxX.sh selinux-sandbox-2.8-rc1/sandboxX.sh index eaa500d..4774528 100644 ---- selinux-sandbox-2.7/sandboxX.sh -+++ selinux-sandbox-2.7/sandboxX.sh +--- selinux-sandbox-2.8-rc1/sandboxX.sh ++++ selinux-sandbox-2.8-rc1/sandboxX.sh @@ -20,7 +20,7 @@ cat > ~/.config/openbox/rc.xml << EOF EOF diff --git a/semodule-utils-fedora.patch b/semodule-utils-fedora.patch index e6dd4df..e69de29 100644 --- a/semodule-utils-fedora.patch +++ b/semodule-utils-fedora.patch @@ -1,125 +0,0 @@ -diff --git semodule-utils-2.7/Makefile semodule-utils-2.7/Makefile -index 6bf4aee..e0a6579 100644 ---- semodule-utils-2.7/Makefile -+++ semodule-utils-2.7/Makefile -@@ -1,4 +1,4 @@ --SUBDIRS = semodule_package semodule_link semodule_expand semodule_deps -+SUBDIRS = semodule_package semodule_link semodule_expand - - all install relabel clean indent: - @for subdir in $(SUBDIRS); do \ -diff --git semodule-utils-2.7/semodule_expand/Makefile semodule-utils-2.7/semodule_expand/Makefile -index 072f213..f1a1c8f 100644 ---- semodule-utils-2.7/semodule_expand/Makefile -+++ semodule-utils-2.7/semodule_expand/Makefile -@@ -1,8 +1,6 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --INCLUDEDIR ?= $(PREFIX)/include -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin --LIBDIR ?= $(PREFIX)/lib - MANDIR ?= $(PREFIX)/share/man - - CFLAGS ?= -Werror -Wall -W -@@ -13,10 +11,10 @@ all: semodule_expand - semodule_expand: semodule_expand.o - - install: all -- -mkdir -p $(BINDIR) -- install -m 755 semodule_expand $(BINDIR) -- test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8 -- install -m 644 semodule_expand.8 $(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(BINDIR) -+ install -m 755 semodule_expand $(DESTDIR)$(BINDIR) -+ test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 semodule_expand.8 $(DESTDIR)$(MANDIR)/man8/ - - relabel: - -diff --git semodule-utils-2.7/semodule_link/Makefile semodule-utils-2.7/semodule_link/Makefile -index cc4687b..692cb02 100644 ---- semodule-utils-2.7/semodule_link/Makefile -+++ semodule-utils-2.7/semodule_link/Makefile -@@ -1,9 +1,7 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --INCLUDEDIR ?= $(PREFIX)/include -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin - MANDIR ?= $(PREFIX)/share/man --LIBDIR ?= $(PREFIX)/lib - - CFLAGS ?= -Werror -Wall -W - override LDLIBS += -lsepol -@@ -13,10 +11,10 @@ all: semodule_link - semodule_link: semodule_link.o - - install: all -- -mkdir -p $(BINDIR) -- install -m 755 semodule_link $(BINDIR) -- test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8 -- install -m 644 semodule_link.8 $(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(BINDIR) -+ install -m 755 semodule_link $(DESTDIR)$(BINDIR) -+ test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 semodule_link.8 $(DESTDIR)$(MANDIR)/man8/ - - relabel: - -diff --git semodule-utils-2.7/semodule_package/Makefile semodule-utils-2.7/semodule_package/Makefile -index 96dd7c4..da17026 100644 ---- semodule-utils-2.7/semodule_package/Makefile -+++ semodule-utils-2.7/semodule_package/Makefile -@@ -1,8 +1,6 @@ - # Installation directories. --PREFIX ?= $(DESTDIR)/usr --INCLUDEDIR ?= $(PREFIX)/include -+PREFIX ?= /usr - BINDIR ?= $(PREFIX)/bin --LIBDIR ?= $(PREFIX)/lib - MANDIR ?= $(PREFIX)/share/man - - CFLAGS ?= -Werror -Wall -W -@@ -13,12 +11,12 @@ all: semodule_package semodule_unpackage - semodule_package: semodule_package.o - - install: all -- -mkdir -p $(BINDIR) -- install -m 755 semodule_package $(BINDIR) -- install -m 755 semodule_unpackage $(BINDIR) -- test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8 -- install -m 644 semodule_package.8 $(MANDIR)/man8/ -- install -m 644 semodule_unpackage.8 $(MANDIR)/man8/ -+ -mkdir -p $(DESTDIR)$(BINDIR) -+ install -m 755 semodule_package $(DESTDIR)$(BINDIR) -+ install -m 755 semodule_unpackage $(DESTDIR)$(BINDIR) -+ test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8 -+ install -m 644 semodule_package.8 $(DESTDIR)$(MANDIR)/man8/ -+ install -m 644 semodule_unpackage.8 $(DESTDIR)$(MANDIR)/man8/ - - relabel: - -diff --git semodule-utils-2.7/semodule_package/semodule_unpackage.8 semodule-utils-2.7/semodule_package/semodule_unpackage.8 -index d6e1be0..5c92bf5 100644 ---- semodule-utils-2.7/semodule_package/semodule_unpackage.8 -+++ semodule-utils-2.7/semodule_package/semodule_unpackage.8 -@@ -1,14 +1,14 @@ - .TH SEMODULE_PACKAGE "8" "Nov 2005" "Security Enhanced Linux" NSA - .SH NAME --semodule_unpackage \- Extract policy module and file context file from an SELinux policy module unpackage. -+semodule_unpackage \- Extract policy module and file context file from an SELinux policy module package. - - .SH SYNOPSIS --.B semodule_unpackage [] -+.B semodule_unpackage ppfile modfile [fcfile] - .br - .SH DESCRIPTION - .PP --semodule_unpackage is the tool used to extract the SELinux policy module -- and file context file from an SELinux Policy Package. -+semodule_unpackage is a tool used to extract SELinux policy module -+file and file context file from an SELinux Policy Package. - - .SH EXAMPLE - .nf diff --git a/sources b/sources index 312e013..44d2e3d 100644 --- a/sources +++ b/sources @@ -1,8 +1,8 @@ SHA512 (policycoreutils_man_ru2.tar.bz2) = 7272801da169b8d7dd3f8b7e368a63a4fbb7ae94599f9384bc450d142e6b2a3805ab542d650cbe9c8978c2d8e5c56ef4c11f361abfefeaf184ec3a4b0d2afb4c -SHA512 (policycoreutils-2.7.tar.gz) = ce97d659f72058fd23d8dab8db98fc7c0003806a636c521fa15da465d7358d40ccc8e3eaa9675f00a9b0b8aaa1465d3fb650bc0ebbbf00164e121230673256fb -SHA512 (selinux-python-2.7.tar.gz) = df8645e7ac9ca568f0c9d81c42b93d0abadc43c22f14d38451ab262b52132cfb7abd7742e3a00ab9c153f95dd5b23b3a496d84875debcd9787f75d940eb45c28 -SHA512 (selinux-gui-2.7.tar.gz) = 55bfa4216dabc1711324d03c6e0b2034ab04e72d32921adbeee89b08eea7b1f558a5eeaa14b8ad1bdcffcfe10efa9cb692dc783b4f0c21fe2e3e3063c20e0b7f -SHA512 (selinux-sandbox-2.7.tar.gz) = 3f994dc296d150f3307d20e3295ad565fd86f78701ec4601493f2f4b1c91a8aa68a9ec8b6418fd9bacb9e9d32b6798cdc7e1eabc26f9b6c306affad3261ffb8a -SHA512 (selinux-dbus-2.7.tar.gz) = 73f6731af302573cf7b20b93e7bc6da677dfd57342b097888537fd6383157c72b0fb047a4f586614fd968e8ed7f0f2b517f0abdf44dd6107aa428b7a39f93f9e -SHA512 (semodule-utils-2.7.tar.gz) = 5c7c2a2224949f50c1119edba90d937363e22af52a38f06525e957b29f5310a3e3444d03980b2f808ce995de0f9fc0a9dca8b6167bbfde29c1a33b9bc786d3c8 -SHA512 (restorecond-2.7.tar.gz) = c81950e4f748a729c8951b13a4075ab1003530f8ada7a9d3fbe6428f76070df4819a37daaab557b63fc234aa8c8320ec41757fbdb24b76fa2c11747bde0038ad +SHA512 (policycoreutils-2.8-rc1.tar.gz) = 252b1a2784221cd1b960d584e17c3c116b46a36ef4900510f8caf34908784dd1d19d2a5d2c394aaa4d920485183365af2ab23056eb5867ccbaf284e2ca8612cd +SHA512 (restorecond-2.8-rc1.tar.gz) = 9b90485998bbabeb26d1ca197b78dadc2ad4aa15fc3eb30f16809e631009ce07f2a624d8e0c139cb6ea831ff46068de2744168c6ee0414693716b4963c8e3be9 +SHA512 (selinux-dbus-2.8-rc1.tar.gz) = bf48553735b9629f29c380fc10f5f484a756cfa36e4d54783639194337ba0f9ff27c9f82cd11240debc282952c0fdb7c1d4440fe82d372fd160a04b62ab26be7 +SHA512 (selinux-gui-2.8-rc1.tar.gz) = e39098c751c24252609759124e379db22d28abd005181826ef334d063dfc4f61f65c64a481f25599cb753be768e21ae7f449522bce8c56b82893919674e6eff5 +SHA512 (selinux-python-2.8-rc1.tar.gz) = bce5823ac4c24f1bceae9219a07fc9e6192d703e044711f9dfc170946dde411b833cb7a6d0c175e569efcd878a75a8df33dda0498e3da888f60b7adf9d5448a1 +SHA512 (selinux-sandbox-2.8-rc1.tar.gz) = 937ecd38e13e97b3d98f2af2825ad459113cdf55116a3aaf6a007d911a69f6f0b03951ab11ced80e521f90da1da53ed8a97815e0336121b27bbdaf78ee2f14c7 +SHA512 (semodule-utils-2.8-rc1.tar.gz) = 489ee453a5c0f6bac754f8056f738c32a815fc055daa2c1fc93c63a5e8a4c5cf017e3d687a4ba432bef0a789ed972c1a90bc56487b4014b486c0bf7ca079c565