From 631ac99a6f14dddc21faa14cb9067c7aec7f67ec Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@redhat.com>
Date: Fri, 11 Oct 2013 10:16:57 -0400
Subject: [PATCH 65/74] These are massive changes involved in building new GUI.

Too difficult to break out into seperate patches at this point.
Since almost no other groups are using sepolicy yet, I will push together.
---
 policycoreutils/sepolicy/.gitignore                |    2 +
 policycoreutils/sepolicy/Makefile                  |   18 +-
 policycoreutils/sepolicy/org.selinux.conf          |   23 +
 policycoreutils/sepolicy/org.selinux.policy        |   80 +
 policycoreutils/sepolicy/org.selinux.service       |    4 +
 policycoreutils/sepolicy/selinux_client.py         |   43 +
 policycoreutils/sepolicy/selinux_server.py         |  131 +
 policycoreutils/sepolicy/sepolgen.8                |    1 +
 .../sepolicy/sepolicy-bash-completion.sh           |   24 +-
 policycoreutils/sepolicy/sepolicy-generate.8       |   71 +-
 policycoreutils/sepolicy/sepolicy-gui.8            |   29 +
 policycoreutils/sepolicy/sepolicy-interface.8      |   11 +-
 policycoreutils/sepolicy/sepolicy-manpage.8        |    5 +-
 policycoreutils/sepolicy/sepolicy-network.8        |   58 +-
 policycoreutils/sepolicy/sepolicy.8                |    6 +-
 policycoreutils/sepolicy/sepolicy.desktop          |   10 +
 policycoreutils/sepolicy/sepolicy.py               |  397 +-
 policycoreutils/sepolicy/sepolicy/__init__.py      |  866 ++-
 policycoreutils/sepolicy/sepolicy/communicate.py   |    2 +-
 policycoreutils/sepolicy/sepolicy/generate.py      |  127 +-
 policycoreutils/sepolicy/sepolicy/gui.py           | 2833 ++++++++++
 policycoreutils/sepolicy/sepolicy/help/__init__.py |    0
 .../sepolicy/sepolicy/help/booleans.png            |  Bin 0 -> 72749 bytes
 .../sepolicy/sepolicy/help/booleans.txt            |    7 +
 .../sepolicy/sepolicy/help/booleans_more.png       |  Bin 0 -> 62348 bytes
 .../sepolicy/sepolicy/help/booleans_more.txt       |    5 +
 .../sepolicy/sepolicy/help/booleans_more_show.png  |  Bin 0 -> 34948 bytes
 .../sepolicy/sepolicy/help/booleans_more_show.txt  |    4 +
 .../sepolicy/sepolicy/help/booleans_toggled.png    |  Bin 0 -> 61958 bytes
 .../sepolicy/sepolicy/help/booleans_toggled.txt    |    5 +
 .../sepolicy/sepolicy/help/file_equiv.png          |  Bin 0 -> 49221 bytes
 .../sepolicy/sepolicy/help/file_equiv.txt          |   21 +
 .../sepolicy/sepolicy/help/files_apps.png          |  Bin 0 -> 81978 bytes
 .../sepolicy/sepolicy/help/files_apps.txt          |   10 +
 .../sepolicy/sepolicy/help/files_exec.png          |  Bin 0 -> 67866 bytes
 .../sepolicy/sepolicy/help/files_exec.txt          |    5 +
 .../sepolicy/sepolicy/help/files_write.png         |  Bin 0 -> 77773 bytes
 .../sepolicy/sepolicy/help/files_write.txt         |   11 +
 .../sepolicy/sepolicy/help/lockdown.png            |  Bin 0 -> 50599 bytes
 .../sepolicy/sepolicy/help/lockdown.txt            |    5 +
 .../sepolicy/sepolicy/help/lockdown_permissive.png |  Bin 0 -> 30025 bytes
 .../sepolicy/sepolicy/help/lockdown_permissive.txt |   11 +
 .../sepolicy/sepolicy/help/lockdown_ptrace.png     |  Bin 0 -> 29336 bytes
 .../sepolicy/sepolicy/help/lockdown_ptrace.txt     |   15 +
 .../sepolicy/sepolicy/help/lockdown_unconfined.png |  Bin 0 -> 27473 bytes
 .../sepolicy/sepolicy/help/lockdown_unconfined.txt |   11 +
 policycoreutils/sepolicy/sepolicy/help/login.png   |  Bin 0 -> 40102 bytes
 policycoreutils/sepolicy/sepolicy/help/login.txt   |   23 +
 .../sepolicy/sepolicy/help/login_default.png       |  Bin 0 -> 41680 bytes
 .../sepolicy/sepolicy/help/login_default.txt       |   10 +
 .../sepolicy/sepolicy/help/ports_inbound.png       |  Bin 0 -> 58994 bytes
 .../sepolicy/sepolicy/help/ports_inbound.txt       |    8 +
 .../sepolicy/sepolicy/help/ports_outbound.png      |  Bin 0 -> 52979 bytes
 .../sepolicy/sepolicy/help/ports_outbound.txt      |    8 +
 policycoreutils/sepolicy/sepolicy/help/start.png   |  Bin 0 -> 14128 bytes
 policycoreutils/sepolicy/sepolicy/help/start.txt   |    7 +
 policycoreutils/sepolicy/sepolicy/help/system.png  |  Bin 0 -> 50601 bytes
 policycoreutils/sepolicy/sepolicy/help/system.txt  |    2 +
 .../sepolicy/sepolicy/help/system_boot_mode.png    |  Bin 0 -> 52674 bytes
 .../sepolicy/sepolicy/help/system_boot_mode.txt    |   14 +
 .../sepolicy/sepolicy/help/system_current_mode.png |  Bin 0 -> 52641 bytes
 .../sepolicy/sepolicy/help/system_current_mode.txt |    8 +
 .../sepolicy/sepolicy/help/system_export.png       |  Bin 0 -> 53210 bytes
 .../sepolicy/sepolicy/help/system_export.txt       |    8 +
 .../sepolicy/sepolicy/help/system_policy_type.png  |  Bin 0 -> 54631 bytes
 .../sepolicy/sepolicy/help/system_policy_type.txt  |    6 +
 .../sepolicy/sepolicy/help/system_relabel.png      |  Bin 0 -> 52867 bytes
 .../sepolicy/sepolicy/help/system_relabel.txt      |   12 +
 .../sepolicy/sepolicy/help/transition_file.png     |  Bin 0 -> 69779 bytes
 .../sepolicy/sepolicy/help/transition_file.txt     |   16 +
 .../sepolicy/sepolicy/help/transition_from.png     |  Bin 0 -> 63231 bytes
 .../sepolicy/sepolicy/help/transition_from.txt     |   11 +
 .../sepolicy/help/transition_from_boolean.png      |  Bin 0 -> 67329 bytes
 .../sepolicy/help/transition_from_boolean.txt      |    9 +
 .../sepolicy/help/transition_from_boolean_1.png    |  Bin 0 -> 71717 bytes
 .../sepolicy/help/transition_from_boolean_1.txt    |    2 +
 .../sepolicy/help/transition_from_boolean_2.png    |  Bin 0 -> 32219 bytes
 .../sepolicy/help/transition_from_boolean_2.txt    |    5 +
 .../sepolicy/sepolicy/help/transition_to.png       |  Bin 0 -> 58909 bytes
 .../sepolicy/sepolicy/help/transition_to.txt       |   11 +
 policycoreutils/sepolicy/sepolicy/help/users.png   |  Bin 0 -> 57622 bytes
 policycoreutils/sepolicy/sepolicy/help/users.txt   |   21 +
 policycoreutils/sepolicy/sepolicy/interface.py     |  198 +-
 policycoreutils/sepolicy/sepolicy/manpage.py       |  283 +-
 policycoreutils/sepolicy/sepolicy/network.py       |   42 +-
 policycoreutils/sepolicy/sepolicy/sedbus.py        |   58 +
 policycoreutils/sepolicy/sepolicy/sepolicy.glade   | 5633 ++++++++++++++++++++
 .../sepolicy/sepolicy/templates/network.py         |    3 +
 .../sepolicy/sepolicy/templates/script.py          |   21 +-
 .../sepolicy/sepolicy/templates/spec.py            |    8 +-
 .../sepolicy/sepolicy/templates/test_module.py     |  119 +
 .../sepolicy/sepolicy/templates/unit_file.py       |    2 +-
 .../sepolicy/sepolicy/templates/user.py            |   14 +-
 policycoreutils/sepolicy/sepolicy/transition.py    |   23 +-
 policycoreutils/sepolicy/setup.py                  |    2 +-
 95 files changed, 10841 insertions(+), 597 deletions(-)
 create mode 100644 policycoreutils/sepolicy/org.selinux.conf
 create mode 100644 policycoreutils/sepolicy/org.selinux.policy
 create mode 100644 policycoreutils/sepolicy/org.selinux.service
 create mode 100644 policycoreutils/sepolicy/selinux_client.py
 create mode 100644 policycoreutils/sepolicy/selinux_server.py
 create mode 100644 policycoreutils/sepolicy/sepolgen.8
 create mode 100644 policycoreutils/sepolicy/sepolicy-gui.8
 create mode 100644 policycoreutils/sepolicy/sepolicy.desktop
 create mode 100644 policycoreutils/sepolicy/sepolicy/gui.py
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/__init__.py
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans_more.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans_more.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans_more_show.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans_more_show.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans_toggled.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/booleans_toggled.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/file_equiv.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/file_equiv.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/files_apps.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/files_apps.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/files_exec.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/files_exec.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/files_write.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/files_write.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown_permissive.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown_permissive.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown_ptrace.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown_ptrace.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown_unconfined.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/lockdown_unconfined.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/login.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/login.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/login_default.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/login_default.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/ports_inbound.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/ports_inbound.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/ports_outbound.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/ports_outbound.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/start.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/start.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_boot_mode.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_boot_mode.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_current_mode.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_current_mode.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_export.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_export.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_policy_type.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_policy_type.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_relabel.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/system_relabel.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_file.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_file.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from_boolean.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from_boolean.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_1.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_1.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_2.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_2.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_to.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/transition_to.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/users.png
 create mode 100644 policycoreutils/sepolicy/sepolicy/help/users.txt
 create mode 100644 policycoreutils/sepolicy/sepolicy/sedbus.py
 create mode 100644 policycoreutils/sepolicy/sepolicy/sepolicy.glade
 create mode 100644 policycoreutils/sepolicy/sepolicy/templates/test_module.py

diff --git a/policycoreutils/sepolicy/.gitignore b/policycoreutils/sepolicy/.gitignore
index 378eac2..3186c86 100644
--- a/policycoreutils/sepolicy/.gitignore
+++ b/policycoreutils/sepolicy/.gitignore
@@ -1 +1,3 @@
 build
+tmp
+*.bak
diff --git a/policycoreutils/sepolicy/Makefile b/policycoreutils/sepolicy/Makefile
index 71d661c..90e31dd 100644
--- a/policycoreutils/sepolicy/Makefile
+++ b/policycoreutils/sepolicy/Makefile
@@ -4,10 +4,11 @@ SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig
 LIBDIR ?= $(PREFIX)/lib
 BINDIR ?= $(PREFIX)/bin
 SBINDIR ?= $(PREFIX)/sbin
+DATADIR ?= $(PREFIX)/share
 MANDIR ?= $(PREFIX)/share/man
 LOCALEDIR ?= /usr/share/locale
 PYTHON ?= /usr/bin/python
-BASHCOMPLETIONDIR ?= $(DESTDIR)/etc/bash_completion.d/
+BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions
 SHAREDIR ?= $(PREFIX)/share/sandbox
 override CFLAGS = -I$(PREFIX)/include -DPACKAGE="policycoreutils" -Wall -Werror -Wextra -W  -DSHARED -shared
 
@@ -22,6 +23,9 @@ clean:
 	$(PYTHON) setup.py clean
 	-rm -rf build *~ \#* *pyc .#*
 
+sepolgen:
+	ln -sf sepolicy sepolgen
+
 test:
 	@python test_sepolicy.py -v
 
@@ -29,7 +33,17 @@ 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)
+	install -m 644 $(BASHCOMPLETIONS) $(BASHCOMPLETIONDIR)/sepolicy
+	-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
+	install -m 644 *.desktop $(DATADIR)/system-config-selinux
diff --git a/policycoreutils/sepolicy/org.selinux.conf b/policycoreutils/sepolicy/org.selinux.conf
new file mode 100644
index 0000000..a350978
--- /dev/null
+++ b/policycoreutils/sepolicy/org.selinux.conf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
+
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+  <!-- Only root can own the service -->
+  <policy user="root">
+    <allow own="org.selinux"/>
+  </policy>
+
+  <!-- Allow anyone to invoke methods on the interfaces,
+       authorization is performed by PolicyKit -->
+  <policy at_console="true">
+    <allow send_destination="org.selinux"/>
+  </policy>
+  <policy context="default">
+    <allow send_destination="org.selinux"
+	   send_interface="org.freedesktop.DBus.Introspectable"/>
+  </policy>
+
+</busconfig>
diff --git a/policycoreutils/sepolicy/org.selinux.policy b/policycoreutils/sepolicy/org.selinux.policy
new file mode 100644
index 0000000..c0a730c
--- /dev/null
+++ b/policycoreutils/sepolicy/org.selinux.policy
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+<policyconfig>
+
+    <vendor>Red Hat Inc.</vendor>
+    <vendor_url>http://www.redhat.com</vendor_url>
+
+    <action id="org.selinux.restorecon">
+        <description>SELinux write access</description>
+        <message>System policy prevents restorecon access to SELinux</message>
+        <defaults>
+            <allow_any>auth_admin_keep</allow_any>
+            <allow_inactive>auth_admin_keep</allow_inactive>
+            <allow_active>auth_admin_keep</allow_active>
+        </defaults>
+    </action>
+    <action id="org.selinux.setenforce">
+        <description>SELinux write access</description>
+        <message>System policy prevents setenforce access to SELinux</message>
+        <defaults>
+            <allow_any>auth_admin_keep</allow_any>
+            <allow_inactive>auth_admin_keep</allow_inactive>
+            <allow_active>auth_admin_keep</allow_active>
+        </defaults>
+    </action>
+    <action id="org.selinux.semanage">
+        <description>SELinux write access</description>
+        <message>System policy prevents semanage access to SELinux</message>
+        <defaults>
+            <allow_any>auth_admin_keep</allow_any>
+            <allow_inactive>auth_admin_keep</allow_inactive>
+            <allow_active>auth_admin_keep</allow_active>
+        </defaults>
+    </action>
+    <action id="org.selinux.customized">
+        <description>SELinux Read access</description>
+        <message>System policy prevents read access to SELinux</message>
+        <defaults>
+	  <allow_any>yes</allow_any>
+	  <allow_inactive>yes</allow_inactive>
+	  <allow_active>yes</allow_active>
+        </defaults>
+    </action>
+    <action id="org.selinux.semodule_list">
+        <description>SELinux list modules access</description>
+        <message>System policy prevents read access to SELinux modules</message>
+        <defaults>
+	  <allow_any>yes</allow_any>
+	  <allow_inactive>yes</allow_inactive>
+	  <allow_active>yes</allow_active>
+        </defaults>
+    </action>
+    <action id="org.selinux.relabel_on_boot">
+        <description>SELinux write access</description>
+        <message>System policy prevents relabel_on_boot access to SELinux</message>
+        <defaults>
+            <allow_any>yes</allow_any>
+        </defaults>
+    </action>
+    <action id="org.selinux.change_default_policy">
+        <description>SELinux write access</description>
+        <message>System policy prevents change_default_policy access to SELinux</message>
+        <defaults>
+            <allow_any>auth_admin_keep</allow_any>
+            <allow_inactive>auth_admin_keep</allow_inactive>
+            <allow_active>auth_admin_keep</allow_active>
+        </defaults>
+    </action>
+    <action id="org.selinux.change_policy_type">
+        <description>SELinux write access</description>
+        <message>System policy prevents change_policy_type access to SELinux</message>
+        <defaults>
+            <allow_any>auth_admin_keep</allow_any>
+            <allow_inactive>auth_admin_keep</allow_inactive>
+            <allow_active>auth_admin_keep</allow_active>
+        </defaults>
+    </action>
+</policyconfig>
diff --git a/policycoreutils/sepolicy/org.selinux.service b/policycoreutils/sepolicy/org.selinux.service
new file mode 100644
index 0000000..3dd9545
--- /dev/null
+++ b/policycoreutils/sepolicy/org.selinux.service
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.selinux
+Exec=/usr/share/system-config-selinux/selinux_server.py
+User=root
diff --git a/policycoreutils/sepolicy/selinux_client.py b/policycoreutils/sepolicy/selinux_client.py
new file mode 100644
index 0000000..9d9792c
--- /dev/null
+++ b/policycoreutils/sepolicy/selinux_client.py
@@ -0,0 +1,43 @@
+import dbus
+import dbus.service
+from sepolicy.sedbus import SELinuxDBus
+
+def convert_customization(buf):
+    cust_dict = {}
+    cust_dict["fcontext-equiv"] = {}
+    for i in buf.split("\n"):
+        rec = i.split()
+        if len(rec) == 0:
+            continue
+        if rec[1] == "-D":
+            continue
+        if rec[0] not in cust_dict:
+            cust_dict[rec[0]] = {}
+        if rec[0] == "boolean":
+            cust_dict["boolean"][rec[-1]] = { "active": rec[2] == "-1" }
+        if rec[0] == "login":
+            cust_dict["login"][rec[-1]] = { "seuser": rec[3], "range": rec[5] }
+        if rec[0] == "interface":
+            cust_dict["login"][rec[-1]] = { "type": rec[3] }
+        if rec[0] == "user":
+            cust_dict["user"][rec[-1]] = { "level": rec[3], "range": rec[5], "role": rec[7] }
+        if rec[0] == "port":
+            cust_dict["port"][(rec[-1], rec[-2] )] = { "type": rec[3] }
+        if rec[0] == "node":
+            cust_dict["node"][rec[-1]] = { "mask": rec[3], "protocol":rec[5], "type": rec[7] }
+        if rec[0] == "fcontext":
+            if rec[2] == "-e":
+                cust_dict["fcontext-equiv"][(rec[-1])] = { "equiv": rec[3] }
+            else:
+                cust_dict["fcontext"][(rec[-1],rec[3])] = { "type": rec[5] }
+        if rec[0] == "module":
+            cust_dict["module"][rec[-1]] = { "enabled": rec[2] != "-d" }
+        
+    return cust_dict
+if __name__ == "__main__": 
+    try:
+        dbus_proxy = SELinuxDBus()
+        resp = dbus_proxy.customized()
+        print convert_customization(resp)
+    except dbus.DBusException, e:
+        print e
diff --git a/policycoreutils/sepolicy/selinux_server.py b/policycoreutils/sepolicy/selinux_server.py
new file mode 100644
index 0000000..e5d3103
--- /dev/null
+++ b/policycoreutils/sepolicy/selinux_server.py
@@ -0,0 +1,131 @@
+#!/usr/bin/python
+
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import gobject
+import slip.dbus.service
+from slip.dbus import polkit
+import os
+import selinux
+from subprocess import Popen, PIPE, STDOUT
+
+class selinux_server(slip.dbus.service.Object):
+    default_polkit_auth_required = "org.selinux.semanage"
+    def __init__ (self, *p, **k):
+        super(selinux_server, self).__init__(*p, **k)
+
+    #
+    # The semanage method runs a transaction on a series of semanage commands,
+    # these commnds can take the output of customized
+    # 
+    @slip.dbus.polkit.require_auth("org.selinux.semanage")
+    @dbus.service.method("org.selinux", in_signature='s')
+    def semanage(self, buf):
+        p = Popen(["/usr/sbin/semanage", "import"],stdout=PIPE, stderr=PIPE, stdin=PIPE)
+        p.stdin.write(buf)
+        output = p.communicate()
+        if p.returncode and p.returncode != 0:
+            raise dbus.exceptions.DBusException(output[1])
+        
+    #
+    # The customized method will return all of the custommizations for policy
+    # on the server.  This output can be used with the semanage method on 
+    # another server to make the two systems have duplicate policy.
+    #
+    @slip.dbus.polkit.require_auth("org.selinux.customized")
+    @dbus.service.method("org.selinux", in_signature='', out_signature='s')
+    def customized(self):
+        p = Popen(["/usr/sbin/semanage", "export"],stdout=PIPE, stderr=PIPE)
+        buf = p.stdout.read()
+        output = p.communicate()
+        if p.returncode and p.returncode != 0:
+            raise OSError("Failed to read SELinux configuration: %s", output)
+        return buf
+        
+    #
+    # The semodule_list method will return the output of semodule -l, using the customized polkit,
+    # since this is a readonly behaviour
+    #
+    @slip.dbus.polkit.require_auth("org.selinux.customized")
+    @dbus.service.method("org.selinux", in_signature='', out_signature='s')
+    def semodule_list(self):
+        p = Popen(["/usr/sbin/semodule", "-l"],stdout=PIPE, stderr=PIPE)
+        buf = p.stdout.read()
+        output = p.communicate()
+        if p.returncode and p.returncode != 0:
+            raise OSError("Failed to list SELinux modules: %s", output)
+        return buf
+        
+    #
+    # The restorecon method modifies any file path to the default system label
+    #
+    @dbus.service.method("org.selinux", in_signature='s')
+    def restorecon(self, path):
+        selinux.restorecon(str(path), recursive=1)
+
+    #
+    # The setenforce method turns off the current enforcement of SELinux
+    #
+    @dbus.service.method("org.selinux", in_signature='i')
+    def setenforce(self, value):
+        selinux.security_setenforce(value)
+
+    #
+    # The setenforce method turns off the current enforcement of SELinux
+    #
+    @dbus.service.method("org.selinux", in_signature='i')
+    def relabel_on_boot(self, value):
+        if value == 1:
+            fd = open("/.autorelabel","w")
+            fd.close()
+        else:
+            os.unlink("/.autorelabel")
+
+    def write_selinux_config(self, enforcing=None, policy=None):
+        path = selinux.selinux_path() + "config" 
+        backup_path = path + ".bck"
+        fd = open(path)
+        lines = fd.readlines()
+        fd.close()
+        fd = open(backup_path, "w")
+        for l in lines:
+            if enforcing and l.startswith("SELINUX="):
+                fd.write("SELINUX=%s\n" % enforcing)
+                continue
+            if policy and l.startswith("SELINUXTYPE="):
+                fd.write("SELINUXTYPE=%s\n" % policy)
+                continue
+            fd.write(l)
+        fd.close()
+        os.rename(backup_path, path)
+
+    #
+    # The change_default_enforcement modifies the current enforcement mode 
+    #
+    @dbus.service.method("org.selinux", in_signature='s')
+    def change_default_mode(self, value):
+        values = [ "enforcing", "permissive", "disabled" ]
+        if value not in values:
+            raise ValueError("Enforcement mode must be %s" % ", ".join(values))
+        self.write_selinux_config(enforcing=value)
+        
+
+    #
+    # The change_default_policy method modifies the policy type
+    #
+    @dbus.service.method("org.selinux", in_signature='s')
+    def change_default_policy(self, value):
+        path = selinux.selinux_path() + value
+        if os.path.isdir(path):
+            return self.write_selinux_config(policy=value)
+        raise ValueError("%s does not exist" % path)
+        
+if __name__ == "__main__":
+        mainloop = gobject.MainLoop()
+        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+        system_bus = dbus.SystemBus()
+        name = dbus.service.BusName("org.selinux", system_bus)
+        object = selinux_server(system_bus, "/org/selinux/object")
+        slip.dbus.service.set_mainloop(mainloop)
+        mainloop.run()
diff --git a/policycoreutils/sepolicy/sepolgen.8 b/policycoreutils/sepolicy/sepolgen.8
new file mode 100644
index 0000000..3ecf3eb
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolgen.8
@@ -0,0 +1 @@
+.so man8/sepolicy-generate.8
diff --git a/policycoreutils/sepolicy/sepolicy-bash-completion.sh b/policycoreutils/sepolicy/sepolicy-bash-completion.sh
index 82fea52..779fd75 100644
--- a/policycoreutils/sepolicy/sepolicy-bash-completion.sh
+++ b/policycoreutils/sepolicy/sepolicy-bash-completion.sh
@@ -1,6 +1,6 @@
 # This file is part of systemd.
 #
-# Copyright 2012 Dan Walsh
+# Copyright 2012-2013 Dan Walsh
 #
 # systemd is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -69,6 +69,7 @@ _sepolicy () {
                [BOOLEANS]='booleans'
                [COMMUNICATE]='communicate'
                [GENERATE]='generate'
+               [GUI]='gui'
                [INTERFACE]='interface'
                [MANPAGE]='manpage'
                [NETWORK]='network'
@@ -80,8 +81,9 @@ _sepolicy () {
                [booleans]='-h --help -p --path -a -all -b --boolean'
                [communicate]='-h --help -s --source -t --target -c --class -S --sourceaccess -T --targetaccess'
                [generate]='-a --admin --admin_user --application --cgi --confined_admin --customize  -d --domain --dbus --desktop_user -h --help --inetd --init -n --name --newtype -p --path --sandbox -T --test --term_user -u --user -w --writepath --x_user'
-               [interface]='-h --help -a --list_admin" -u --list_user -l --list'
-               [manpage]='-h --help -p --path -a -all -o --os -d --domain -w --web'
+               [gui]='-h --help'
+               [interface]='-h --help -a --list_admin -c --compile -i --interface -l --list -u --list_user -u --list_user -v --verbose'
+               [manpage]='-h --help -p --path -a -all -o --os -d --domain -w --web -r --root'
                [network]='-h --help -d --domain -l --list -p --port -t --type '
                [transition]='-h --help -s --source -t --target'
         )
@@ -130,17 +132,17 @@ _sepolicy () {
                 COMPREPLY=( $( compgen -d -- "$cur") )
                 compopt -o filenames
                 return 0
-            elif [ "$prev" = "--type" -o "$prev" = "-t" ]; then
-                COMPREPLY=( $(compgen -W '0 1 2 3 4 5 6 7 8 9 10 11' -- "$cur") )
-                return 0
             elif [ "$prev" = "--domain" -o "$prev" = "-d" ]; then
                 COMPREPLY=( $(compgen -W "$( __get_all_domain_types ) " -- "$cur") )
                 return 0
+            elif [ "$prev" = "--newtype" ]; then
+                COMPREPLY=( $(compgen -W "-n --name -t --type" -- "$cur") )
+                return 0
             elif [ "$prev" = "--admin" -o "$prev" = "-a" ]; then
                 COMPREPLY=( $(compgen -W "$( __get_all_admin_interaces ) " -- "$cur") )
                 return 0
             elif [ "$prev" = "--user" -o "$prev" = "-u" ]; then
-                COMPREPLY=( $(compgen -W "$( __get_all_users ) " -- "$cur") )
+                COMPREPLY=( $(compgen -W "$( __get_all_users )" -- "$cur") )
                 return 0
             elif [[ "$cur" == "$verb" || "$cur" == "" || "$cur" == -* ]]; then
                 COMPREPLY=( $(compgen -W '${OPTS[$verb]}' -- "$cur") )
@@ -156,6 +158,10 @@ _sepolicy () {
             if [ "$prev" = "-d" -o "$prev" = "--domain" ]; then
                 COMPREPLY=( $(compgen -W "$( __get_all_domains ) " -- "$cur") )
                 return 0
+            elif test "$prev" = "-r" || test "$prev" = "--root" ; then
+                COMPREPLY=( $( compgen -d -- "$cur") )
+                compopt -o filenames
+                return 0
             elif [ "$prev" = "-o" -o "$prev" = "--os" ]; then
                 return 0
             elif test "$prev" = "-p" || test "$prev" = "--path" ; then
@@ -167,11 +173,11 @@ _sepolicy () {
             return 0
         elif [ "$verb" = "network" ]; then
             if [ "$prev" = "-t" -o "$prev" = "--type" ]; then
-                COMPREPLY=( $(compgen -W "$( __get_all_port_types ) " -- "$cur") )
+                COMPREPLY=( $(compgen -W "$( __get_all_port_types )" -- "$cur") )
                 return 0
             fi
             if [ "$prev" = "-d" -o "$prev" = "--domain" ]; then
-                COMPREPLY=( $(compgen -W "$( __get_all_domain_types ) " -- "$cur") )
+                COMPREPLY=( $(compgen -W "$( __get_all_domain_types )" -- "$cur") )
                 return 0
             fi
             COMPREPLY=( $(compgen -W '${OPTS[$verb]}' -- "$cur") )
diff --git a/policycoreutils/sepolicy/sepolicy-generate.8 b/policycoreutils/sepolicy/sepolicy-generate.8
index fb84af6..9408c5e 100644
--- a/policycoreutils/sepolicy/sepolicy-generate.8
+++ b/policycoreutils/sepolicy/sepolicy-generate.8
@@ -4,16 +4,66 @@ sepolicy-generate \- Generate an initial SELinux policy module template.
 
 .SH "SYNOPSIS"
 
+Common options
+
+.B sepolicy generate [\-h ] [\-p PATH]
+
 .br
-.B sepolicy generate [\-h] [\-d DOMAIN] [\-u USER] [\-w WRITE_PATH ] [\-a ADMIN_DOMAIN] [\-n NAME] [\-p PATH] [\-\-admin_user | \-\-application | \-\-cgi | \-\-confined_admin | \-\-customize | \-\-dbus | \-\-desktop_user | \-\-inetd | \-\-newtype | \-\-init | \-\-sandbox | \-\-term_user | \-\-x_user]
+
+Confined Applications
+
+.br
+.B sepolicy generate \-\-application [\-n NAME] command [\-w WRITE_PATH ] 
+.br
+.B sepolicy generate \-\-cgi [\-n NAME] command [\-w WRITE_PATH ] 
+.br
+.B sepolicy generate \-\-dbus [\-n NAME] command [\-w WRITE_PATH ] 
+.br
+.B sepolicy generate \-\-inetd [\-n NAME] command [\-w WRITE_PATH ] 
+.br
+.B sepolicy generate \-\-init [\-n NAME] command [\-w WRITE_PATH ] 
+
+Confined Users
+
+.br
+.B sepolicy generate \-\-admin_user [\-r TRANSITION_ROLE] \-n NAME
+.br
+.B sepolicy generate \-\-confined_admin \-n NAME [\-a ADMIN_DOMAIN] [\-u USER] [\-n NAME] [\-w WRITE_PATH]
+.br
+.B sepolicy generate \-\-desktop_user \-n NAME [\-w WRITE_PATH]
+.br
+.B sepolicy generate \-\-term_user \-n NAME [\-w WRITE_PATH]
+.br
+.B sepolicy generate \-\-x_user \-n NAME [\-w WRITE_PATH]
+.br
+
+Miscellaneous Policy
+
+.br
+.B sepolicy generate \-\-customize \-d DOMAIN \-n NAME [\-a ADMIN_DOMAIN]
+.br
+.B sepolicy generate \-\-newtype \-t type \-n NAME
+.br
+.B sepolicy generate \-\-sandbox \-n NAME
 
 .SH "DESCRIPTION"
-Use sepolicy generate to generate an SELinux policy Module.  sepolicy generate will generate 4 files.
+Use \fBsepolicy generate\fP to generate an SELinux policy Module.
+
+.br
+\fBsepolicy generate\fP will create 5 files.
+
+When specifying a \fBconfined application\fP you must specify a
+path. \fBsepolicy generate\fP will use the rpm payload of the
+application along with \fBnm -D APPLICATION\fP to help it generate
+types and policy rules for your policy files.
 
 .B Type Enforcing File NAME.te
 .br
 This file can be used to define all the types rules for a particular domain.
 
+.I Note:
+Policy generated by \fBsepolicy generate\fP will automatically add a permissive DOMAIN to your te file.  When you are satisfied that your policy works, you need to remove the permissive line from the te file to run your domain in enforcing mode.
+
 .B Interface File NAME.if
 .br
 This file defines the interfaces for the types generated in the te file, which can be used by other policy domains.
@@ -25,7 +75,7 @@ file paths to the types.  Tools like restorecon and RPM will use these paths to
 
 .B RPM Spec File NAME_selinux.spec
 .br
-This file is an RPM SPEC file that can be used to install the SELinux policy on to machines and setup the labeling. The spec file also installs the interface file and a man page describing the policy.  You can use sepolicy manpage -d NAME to generate the man page.
+This file is an RPM SPEC file that can be used to install the SELinux policy on to machines and setup the labeling. The spec file also installs the interface file and a man page describing the policy.  You can use \fBsepolicy manpage -d NAME\fP to generate the man page.
 
 .B Shell File NAME.sh
 .br
@@ -39,13 +89,22 @@ If a generate is possible, this tool will print out all generate paths from the
 .I                \-h, \-\-help
 Display help message
 .TP
+.I                \-d, \-\-domain
+Enter domain type(s) which you will be extending
+.TP
 .I                \-n, \-\-name
-Specify alternate name of policy. The policy will default to the executable or name specified.
+Specify alternate name of policy. The policy will default to the executable or name specified
 .TP
 .I                \-p, \-\-path
 Specify the directory to store the created policy files. (Default to current working directory )
 optional arguments:
 .TP
+.I                \-r, \-\-role
+Enter role(s) to which this admin user will transition.
+.TP
+.I                \-t, \-\-type
+Enter type(s) for which you will generate new definition and rule(s)
+.TP
 .I                \-u, \-\-user
 SELinux user(s) which will transition to this domain
 .TP
@@ -53,7 +112,7 @@ SELinux user(s) which will transition to this domain
 Path(s) which the confined processes need to write
 .TP
 .I                \-a, \-\-admin
-Domain(s) that this confined admin will administrate
+Domain(s) which the confined admin will administrate
 .TP
 .I  \-\-admin_user 
 Generate Policy for Administrator Login User Role
@@ -95,7 +154,7 @@ Generate Policy for Minimal Terminal Login User Role
 Generate Policy for Minimal X Windows Login User Role
 
 .SH "EXAMPLE"
-.B > sepolicy generate /usr/sbin/rwhod
+.B > sepolicy generate --init /usr/sbin/rwhod
 .br
 Generating Policy for /usr/sbin/rwhod named rwhod
 .br
diff --git a/policycoreutils/sepolicy/sepolicy-gui.8 b/policycoreutils/sepolicy/sepolicy-gui.8
new file mode 100644
index 0000000..6f4bee0
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy-gui.8
@@ -0,0 +1,29 @@
+.TH "sepolicy-gui" "8" "20121005" "" ""
+.SH "NAME"
+sepolicy-gui \- Graphical User Interface for SELinux policy.
+
+.SH "SYNOPSIS"
+
+Common options
+
+.B sepolicy gui [\-h ] [ \-d DOMAIN ]
+
+.br
+
+.SH "DESCRIPTION"
+Use \fBsepolicy gui\fP to run a the graphical user interface, which 
+allows you to explore how SELinux confines different process domains.
+
+.SH "OPTIONS"
+.TP
+.I                \-h, \-\-help
+Display help message
+.TP
+.I                \-d, \-\-domain     
+Initialize gui to the selected domain.
+
+.SH "AUTHOR"
+This man page was written by Daniel Walsh <dwalsh@redhat.com>
+
+.SH "SEE ALSO"
+sepolicy(8), selinux(8)
diff --git a/policycoreutils/sepolicy/sepolicy-interface.8 b/policycoreutils/sepolicy/sepolicy-interface.8
index 4fc9792..02c4c1a 100644
--- a/policycoreutils/sepolicy/sepolicy-interface.8
+++ b/policycoreutils/sepolicy/sepolicy-interface.8
@@ -5,7 +5,7 @@ sepolicy-interface \- Print interface information based on the installed SELinux
 .SH "SYNOPSIS"
 
 .br
-.B sepolicy interface [\-h] [\-a | \-u | \-l ]
+.B sepolicy interface  [\-h] [\-c] [\-v] [\-a | \-u | \-l | \-i INTERFACE [INTERFACE ... ]]
 
 .SH "DESCRIPTION"
 Use sepolicy interface to print interfaces information based on SELinux Policy.
@@ -15,14 +15,23 @@ Use sepolicy interface to print interfaces information based on SELinux Policy.
 .I                \-a, \-\-list_admin
 List all domains with admin interface
 .TP
+.I                \-c, \-\-compile
+Test compile of interfaces
+.TP
 .I                \-h, \-\-help       
 Display help message
 .TP
+.I                \-i, \-\-interface
+Interface(s) to be displayed
+.TP
 .I                \-l, \-\-list
 List all interfaces
 .TP
 .I                \-u, \-\-list_user
 List all domains with SELinux user role interface
+.TP
+.I                \-v, \-\-verbose
+Display extended information about the interface including parameters and desctiprion if available.
 
 .SH "AUTHOR"
 This man page was written by Daniel Walsh <dwalsh@redhat.com>
diff --git a/policycoreutils/sepolicy/sepolicy-manpage.8 b/policycoreutils/sepolicy/sepolicy-manpage.8
index b6abdf5..c05c943 100644
--- a/policycoreutils/sepolicy/sepolicy-manpage.8
+++ b/policycoreutils/sepolicy/sepolicy-manpage.8
@@ -5,7 +5,7 @@ sepolicy-manpage \- Generate a man page based on the installed SELinux Policy
 .SH "SYNOPSIS"
 
 .br
-.B sepolicy manpage [\-w] [\-h] [\-p PATH ]  [\-a | \-d ]
+.B sepolicy manpage [\-w] [\-h] [\-p PATH ] [\-r ROOTDIR ] [\-a | \-d ]
 
 .SH "DESCRIPTION"
 Use sepolicy manpage to generate manpages based on SELinux Policy.
@@ -24,6 +24,9 @@ Display help message
 .I                \-p, \-\-path
 Specify the directory to store the created man pages. (Default to /tmp)
 .TP
+.I                \-r, \-\-root
+Specify alternate root directory to generate man pages from. (Default to /)
+.TP
 .I                \-w, \-\-web
 Generate an additional HTML man pages for the specified domain(s).
 
diff --git a/policycoreutils/sepolicy/sepolicy-network.8 b/policycoreutils/sepolicy/sepolicy-network.8
index 4ba92cc..dcddec7 100644
--- a/policycoreutils/sepolicy/sepolicy-network.8
+++ b/policycoreutils/sepolicy/sepolicy-network.8
@@ -5,13 +5,16 @@ sepolicy-network \- Examine the SELinux Policy and generate a network report
 .SH "SYNOPSIS"
 
 .br
-.B sepolicy network [\-h] (\-l | \-p PORT [PORT ...] | \-t TYPE [TYPE ...] | \-d DOMAIN [DOMAIN ...])
+.B sepolicy network [\-h] (\-l | \-a application [application ...] | \-p PORT [PORT ...] | \-t TYPE [TYPE ...] | \-d DOMAIN [DOMAIN ...])
 
 .SH "DESCRIPTION"
 Use sepolicy network to examine SELinux Policy and generate network reports.
 
 .SH "OPTIONS"
 .TP
+.I                \-a, \-\-application
+Generate a report listing the ports to which the specified init application is allowed to connect and or bind.
+.TP
 .I                \-d, \-\-domain     
 Generate a report listing the ports to which the specified domain is allowed to connect and or bind.
 .TP
@@ -27,6 +30,59 @@ Generate a report listing the port numbers associate with the specified SELinux
 .I                \-p, \-\-port
 Generate a report listing the SELinux port types associate with the specified port number.
 
+.SH "EXAMPLES"
+
+.B sepolicy network -p 22
+.br
+22: tcp ssh_port_t 22
+.br
+22: udp reserved_port_t 1-511
+.br
+22: tcp reserved_port_t 1-511
+
+.B sepolicy network -a /usr/sbin/sshd
+.br
+sshd_t: tcp name_connect
+.br
+	111 (portmap_port_t)
+.br
+	53 (dns_port_t)
+.br
+	88, 750, 4444 (kerberos_port_t)
+.br
+	9080 (ocsp_port_t)
+.br
+	9180, 9701, 9443-9447 (pki_ca_port_t)
+.br
+	32768-61000 (ephemeral_port_t)
+.br
+	all ports < 1024 (reserved_port_type)
+.br
+	all ports with out defined types (port_t)
+.br
+sshd_t: tcp name_bind
+.br
+	22 (ssh_port_t)
+.br
+	5900-5983, 5985-5999 (vnc_port_t)
+.br
+	6000-6020 (xserver_port_t)
+.br
+	32768-61000 (ephemeral_port_t)
+.br
+	all ports > 500 and  < 1024 (rpc_port_type)
+.br
+	all ports with out defined types (port_t)
+.br
+sshd_t: udp name_bind
+.br
+	32768-61000 (ephemeral_port_t)
+.br
+	all ports > 500 and  < 1024 (rpc_port_type)
+.br
+	all ports with out defined types (port_t)
+
+
 .SH "AUTHOR"
 This man page was written by Daniel Walsh <dwalsh@redhat.com>
 
diff --git a/policycoreutils/sepolicy/sepolicy.8 b/policycoreutils/sepolicy/sepolicy.8
index 0748ca9..6348287 100644
--- a/policycoreutils/sepolicy/sepolicy.8
+++ b/policycoreutils/sepolicy/sepolicy.8
@@ -25,6 +25,10 @@ Query SELinux policy to see if domains can communicate with each other
 .br 
 .br
 Generate SELinux Policy module template
+.B    gui
+.br 
+.br
+Launch Graphical User Interface for SELinux Policy, requires policycoreutils-gui package.
 .B sepolicy-generate(8)
 .br
 
@@ -68,4 +72,4 @@ Display help message
 This man page was written by Daniel Walsh <dwalsh@redhat.com>
 
 .SH "SEE ALSO"
-selinux(8), sepolicy-booleans(8), sepolicy-communicate(8), sepolicy-generate(8), sepolicy-interface(8),  sepolicy-network(8), sepolicy-manpage(8), sepolicy-transition(8)
+selinux(8), sepolicy-booleans(8), sepolicy-communicate(8), sepolicy-generate(8),sepolicy-gui(8), sepolicy-interface(8),  sepolicy-network(8), sepolicy-manpage(8), sepolicy-transition(8)
diff --git a/policycoreutils/sepolicy/sepolicy.desktop b/policycoreutils/sepolicy/sepolicy.desktop
new file mode 100644
index 0000000..f9d0cec
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=SELinux Policy Management Tool
+Comment=Generate SELinux policy modules
+Icon=system-config-selinux
+Exec=/usr/bin/sepolicy gui
+Type=Application
+Terminal=false
+Categories=System;Security;
+X-Desktop-File-Install-Version=0.2
+Keywords=policy;security;selinux;avc;permission;mac;
diff --git a/policycoreutils/sepolicy/sepolicy.py b/policycoreutils/sepolicy/sepolicy.py
index b25d3b2..2d61ad7 100755
--- a/policycoreutils/sepolicy/sepolicy.py
+++ b/policycoreutils/sepolicy/sepolicy.py
@@ -22,7 +22,9 @@
 #
 #
 import os, sys
-from sepolicy import get_os_version
+import selinux
+import sepolicy
+from sepolicy import get_os_version, get_conditionals, get_conditionals_format_text
 import argparse
 import gettext
 PROGNAME="policycoreutils"
@@ -37,6 +39,9 @@ except IOError:
     import __builtin__
     __builtin__.__dict__['_'] = unicode
 
+usage = "sepolicy generate [-h] [-n NAME] [-p PATH] ["
+usage_dict = {' --newtype':('-t [TYPES [TYPES ...]]',),' --customize':('-d DOMAIN','-a  ADMIN_DOMAIN',"[ -w WRITEPATHS ]",), ' --admin_user':('[-r TRANSITION_ROLE ]',"[ -w WRITEPATHS ]",), ' --application':('COMMAND',"[ -w WRITEPATHS ]",), ' --cgi':('COMMAND',"[ -w WRITEPATHS ]",), ' --confined_admin':('-a  ADMIN_DOMAIN',"[ -w WRITEPATHS ]",), ' --dbus':('COMMAND',"[ -w WRITEPATHS ]",), ' --desktop_user':('',"[ -w WRITEPATHS ]",),' --inetd':('COMMAND',"[ -w WRITEPATHS ]",),' --init':('COMMAND',"[ -w WRITEPATHS ]",), ' --sandbox':("[ -w WRITEPATHS ]",), ' --term_user':("[ -w WRITEPATHS ]",), ' --x_user':("[ -w WRITEPATHS ]",)}
+
 class CheckPath(argparse.Action):
     def __call__(self, parser, namespace, values, option_string=None):
         if not os.path.exists(values):
@@ -45,7 +50,7 @@ class CheckPath(argparse.Action):
 
 class CheckType(argparse.Action):
     def __call__(self, parser, namespace, values, option_string=None):
-        from sepolicy.network import domains
+        domains = sepolicy.get_all_domains()
 
         if isinstance(values,str):
             setattr(namespace, self.dest, values)
@@ -58,9 +63,30 @@ class CheckType(argparse.Action):
                 newval.append(v)
             setattr(namespace, self.dest, newval)
 
+class CheckBoolean(argparse.Action):
+    def __call__(self, parser, namespace, values, option_string=None):
+        booleans = sepolicy.get_all_booleans()
+        newval = getattr(namespace, self.dest)
+        if not newval:
+            newval = []
+
+        if isinstance(values,str):
+            v = selinux.selinux_boolean_sub(values)
+            if v not in booleans:
+                raise ValueError("%s must be an SELinux process domain:\nValid domains: %s" % (v, ", ".join(booleans)))
+            newval.append(v)
+            setattr(namespace, self.dest, newval)
+        else:
+            for value in values:
+                v = selinux.selinux_boolean_sub(value)
+                if v not in booleans:
+                    raise ValueError("%s must be an SELinux boolean:\nValid boolean: %s" % (v, ", ".join(booleans)))
+                newval.append(v)
+            setattr(namespace, self.dest, newval)
+
 class CheckDomain(argparse.Action):
     def __call__(self, parser, namespace, values, option_string=None):
-        from sepolicy.network import domains
+        domains = sepolicy.get_all_domains()
 
         if isinstance(values,str):
             if values not in domains:
@@ -80,7 +106,6 @@ class CheckDomain(argparse.Action):
 all_classes = None
 class CheckClass(argparse.Action):
     def __call__(self, parser, namespace, values, option_string=None):
-        import sepolicy
         global all_classes
         if not all_classes:
                 all_classes = map(lambda x: x['name'], sepolicy.info(sepolicy.TCLASS))
@@ -114,7 +139,7 @@ class CheckPort(argparse.Action):
 
 class CheckPortType(argparse.Action):
     def __call__(self, parser, namespace, values, option_string=None):
-        from sepolicy.network import port_types
+        port_types = sepolicy.get_all_port_types()
         newval = getattr(namespace, self.dest)
         if not newval:
             newval = []
@@ -140,102 +165,185 @@ class CheckPolicyType(argparse.Action):
 
 class CheckUser(argparse.Action):
     def __call__(self, parser, namespace, value, option_string=None):
-        from sepolicy import get_all_users
         newval = getattr(namespace, self.dest)
         if not newval:
             newval = []
-        users = get_all_users()
+        users = sepolicy.get_all_users()
         if value not in users:
                 raise ValueError("%s must be an SELinux user:\nValid users: %s" % (value, ", ".join(users)))
         newval.append(value)
         setattr(namespace, self.dest, newval)
 
+class CheckRole(argparse.Action):
+    def __call__(self, parser, namespace, value, option_string=None):
+        newval = getattr(namespace, self.dest)
+        if not newval:
+            newval = []
+        roles = sepolicy.get_all_roles()
+        if value not in roles:
+                raise ValueError("%s must be an SELinux role:\nValid roles: %s" % (value, ", ".join(roles)))
+        newval.append(value[:-2])
+        setattr(namespace, self.dest, newval)
+
+class InterfaceInfo(argparse.Action):
+    def __call__(self, parser, namespace, values, option_string=None):
+	from sepolicy.interface import get_interface_dict
+        interface_dict = get_interface_dict()
+        for v in values:
+            if v not in interface_dict.keys():
+                raise ValueError(_("Interface %s does not exist.") % v)
+
+        setattr(namespace, self.dest, values)
+
+def generate_custom_usage(usage_text,usage_dict):
+    sorted_keys = []
+    for i in usage_dict.keys():
+        sorted_keys.append(i)
+    sorted_keys.sort()  
+    for k in sorted_keys:
+        usage_text += "%s %s |" % (k,(" ".join(usage_dict[k])))
+    usage_text = usage_text[:-1] + "]"
+    usage_text = _(usage_text)
+
+    return usage_text
+
+def numcmp(val1,val2):
+    try:
+        v1 = int(val1.split(",")[0].split("-")[0])
+        v2 = int(val2.split(",")[0].split("-")[0])
+        if v1 > v2:
+            return 1
+        if v1 == v2:
+            return 0
+        if v1 < v2:
+            return -1
+    except:
+        return cmp(val1,val2)
+
 def _print_net(src, protocol, perm):
-    from sepolicy.network import get_network_connect
-    portdict = get_network_connect(src, protocol, perm)
+    import sepolicy.network
+    portdict = sepolicy.network.get_network_connect(src, protocol, perm)
     if len(portdict) > 0:
-        print "%s: %s %s" % (src, protocol, perm)
+        bold_start="\033[1m"
+        bold_end="\033[0;0m"
+        print "\n"+bold_start+"%s: %s %s" % (src, protocol, perm) + bold_end
+        port_strings=[]
+        boolean_text=""
         for p in portdict:
-            for recs in portdict[p]:
-                print "\t" + recs
+            for t, recs in portdict[p]:
+                cond=get_conditionals(src,t,"%s_socket" % protocol, [perm])
+                if cond:
+                    boolean_text=get_conditionals_format_text(cond)
+                    port_strings.append("%s (%s) %s" % (", ".join(recs), t, boolean_text))
+                else:
+                    port_strings.append("%s (%s)" % (", ".join(recs), t))
+        port_strings.sort(numcmp)
+        for p in port_strings:
+                print "\t" + p
 
 def network(args):
-    from sepolicy.network import portrecsbynum, portrecs, get_network_connect
+    portrecs, portrecsbynum = sepolicy.gen_port_dict()
+    all_ports = []
     if args.list_ports:
-        all_ports = []
         for i in portrecs:
             if i[0] not in all_ports:
                 all_ports.append(i[0])
         all_ports.sort()
         print "\n".join(all_ports)
 
-    if args.port:
-        for port in args.port:
-            found = False
-            for i in portrecsbynum:
-                if i[0] <= port and port <= i[1]:
-                    if i[0] == i[1]:
-                        range = i[0]
-                    else:
-                        range = "%s-%s" % (i[0], i[1])
-                    found = True
-                    print "%d: %s %s %s" % (port, i[2], portrecsbynum[i][0], range)
-            if not found:
-                if port < 500:
-                    print "Undefined reserved port type"
+    for port in args.port:
+        found = False
+        for i in portrecsbynum:
+            if i[0] <= port and port <= i[1]:
+                if i[0] == i[1]:
+                    range = i[0]
                 else:
-                    print "Undefined port type"
-    if args.type:
-        for t in args.type:
-            if (t,'tcp') in portrecs.keys():
-                print "%s: tcp: %s" % (t, ",".join(portrecs[t,'tcp']))
-            if (t,'udp') in portrecs.keys():
-                print "%s: udp: %s" % (t, ",".join(portrecs[t,'udp']))
-    if args.domain:
-        for d in args.domain:
-            _print_net(d, "tcp", "name_connect")
-            for net in ("tcp", "udp"):
-                _print_net(d, net, "name_bind")
+                    range = "%s-%s" % (i[0], i[1])
+                found = True
+                print "%d: %s %s %s" % (port, i[2], portrecsbynum[i][0], range)
+        if not found:
+            if port < 500:
+                print "Undefined reserved port type"
+            else:
+                print "Undefined port type"
+
+    for t in args.type:
+        if (t,'tcp') in portrecs.keys():
+            print "%s: tcp: %s" % (t, ",".join(portrecs[t,'tcp']))
+        if (t,'udp') in portrecs.keys():
+            print "%s: udp: %s" % (t, ",".join(portrecs[t,'udp']))
+
+    for a in args.applications:
+        d = sepolicy.get_init_transtype(a)
+        if d:
+            args.domain.append(d)
+
+    for d in args.domain:
+        _print_net(d, "tcp", "name_connect")
+        for net in ("tcp", "udp"):
+            _print_net(d, net, "name_bind")
+
+def gui_run(args):
+    try:
+        import sepolicy.gui
+        sepolicy.gui.SELinuxGui(args.domain, args.test)
+        pass 
+    except ImportError:
+        raise ValueError(_("You need to install policycoreutils-gui package to use the gui option"))
+
+def gen_gui_args(parser):
+    gui = parser.add_parser("gui",
+                            help=_('Graphical User Interface for SELinux Policy'))
+    gui.add_argument("-d", "--domain", default=None,
+                       action=CheckDomain,
+                       help=_("Domain name(s) of man pages to be created"))
+    gui.add_argument("-t", "--test", default=False, action="store_true", 
+                       help=argparse.SUPPRESS)
+    gui.set_defaults(func=gui_run)
 
 def manpage(args):
     from sepolicy.manpage import ManPage, HTMLManPages, manpage_domains, manpage_roles, gen_domains
 
     path = args.path
-    if args.policy:
-        for f in ( "policy.xml", "file_context", "file_context.homedirs"):
-            if not os.path.exists(path + f):
-                raise ValueError("manpage creation with alternate policy requires the %s file exist" % (path + f))
-
+    if not args.policy and args.root != "/":
+        sepolicy.policy(sepolicy.get_installed_policy(args.root))
+    if args.source_files and args.root == "/":
+        raise ValueError(_("Alternative root needs to be setup"))
+                
     if args.all:
         test_domains = gen_domains()
     else:
         test_domains = args.domain
 
     for domain in test_domains:
-        m = ManPage(domain, path, args.web)
+        m = ManPage(domain, path, args.root,args.source_files, args.web)
         print m.get_man_page_path()
 
     if args.web:
         HTMLManPages(manpage_roles, manpage_domains, path, args.os)
 
 def gen_manpage_args(parser):
-        man = parser.add_parser("manpage",
-                                   help=_('Generate SELinux man pages'))
-
-        man.add_argument("-p", "--path", dest="path", default="/tmp",
-                         help=_("path in which the generated SELinux man pages will be stored"))
-        man.add_argument("-o", "--os", dest="os", default=get_os_version(),
-                         help=_("name of the OS for man pages"))
-        man.add_argument("-w", "--web", dest="web", default=False, action="store_true",
-                                help=_("Generate HTML man pages structure for selected SELinux man page"))
-        group = man.add_mutually_exclusive_group(required=True)
-        group.add_argument("-a", "--all", dest="all", default=False,
-                           action="store_true",
-                           help=_("All domains"))
-        group.add_argument("-d", "--domain", nargs="+",
-                           action=CheckDomain,
-                           help=_("Domain name(s) of man pages to be created"))
-        man.set_defaults(func=manpage)
+    man = parser.add_parser("manpage",
+                            help=_('Generate SELinux man pages'))
+
+    man.add_argument("-p", "--path", dest="path", default="/tmp",
+                     help=_("path in which the generated SELinux man pages will be stored"))
+    man.add_argument("-o", "--os", dest="os", default=get_os_version(),
+                     help=_("name of the OS for man pages"))
+    man.add_argument("-w", "--web", dest="web", default=False, action="store_true",
+                     help=_("Generate HTML man pages structure for selected SELinux man page"))
+    man.add_argument("-r", "--root", dest="root", default="/",
+                     help=_("Alternate root directory, defaults to /"))
+    man.add_argument("--source_files", dest="source_files", default=False, action="store_true",
+                     help=_("With this flag, alternative root path needs to include file context files and policy.xml file"))
+    group = man.add_mutually_exclusive_group(required=True)
+    group.add_argument("-a", "--all", dest="all", default=False,
+                       action="store_true",
+                       help=_("All domains"))
+    group.add_argument("-d", "--domain", nargs="+",
+                       action=CheckDomain,
+                       help=_("Domain name(s) of man pages to be created"))
+    man.set_defaults(func=manpage)
 
 def gen_network_args(parser):
         net = parser.add_parser("network",
@@ -245,15 +353,18 @@ def gen_network_args(parser):
         group.add_argument("-l", "--list", dest="list_ports",
                            action="store_true",
                             help=_("list all SELinux port types"))
-        group.add_argument("-p", "--port", dest="port", default=None,
+        group.add_argument("-p", "--port", dest="port", default=[],
                             action=CheckPort, nargs="+", type=int,
                             help=_("show SELinux type related to the port"))
-        group.add_argument("-t", "--type", dest="type", default=None,
+        group.add_argument("-t", "--type", dest="type", default=[],
                             action=CheckPortType,nargs="+",
                             help=_("Show ports defined for this SELinux type"))
-        group.add_argument("-d", "--domain", dest="domain", default=None,
+        group.add_argument("-d", "--domain", dest="domain", default=[],
                             action=CheckDomain, nargs="+",
                             help=_("show ports to which this domain can bind and/or connect"))
+        group.add_argument("-a", "--application", dest="applications", default=[],
+                           nargs="+",
+                           help=_("show ports to which this application can bind and/or connect"))
         net.set_defaults(func=network)
 
 def communicate(args):
@@ -283,7 +394,6 @@ def gen_communicate_args(parser):
     comm.set_defaults(func=communicate)
 
 def booleans(args):
-    import selinux
     from sepolicy import boolean_desc
     if args.all:
         rc, args.booleans = selinux.security_get_boolean_names()
@@ -300,6 +410,7 @@ def gen_booleans_args(parser):
                        action="store_true",
                        help=_("get all booleans descriptions"))
     group.add_argument("-b", "--boolean", dest="booleans", nargs="+",
+                       action=CheckBoolean, required=False,
                        help=_("boolean to get description"))
     bools.set_defaults(func=booleans)
 
@@ -319,22 +430,49 @@ def gen_transition_args(parser):
                        help=_("target process domain"))
     trans.set_defaults(func=transition)
 
+def print_interfaces(interfaces, args, append=""):
+    from sepolicy.interface import get_interface_format_text, interface_compile_test
+    for i in interfaces:
+        if args.verbose:
+            try:
+                print get_interface_format_text(i + append)
+            except KeyError:
+                print i
+        if args.compile:
+            try:
+                interface_compile_test(i)
+            except KeyError:
+                print i
+        else:
+            print i
+    
 def interface(args):
-    from sepolicy.interface import get_admin, get, get_user
+    from sepolicy.interface import get_admin, get_user, get_interface_dict, get_all_interfaces
     if args.list_admin:
-        for a in get_admin():
-            print a
+        print_interfaces(get_admin(args.file), args, "_admin")
     if args.list_user:
-        for a in get_user():
-            print a
+        print_interfaces(get_user(args.file), args, "_role")
     if args.list:
-        for m in get():
-            print m
+        print_interfaces(get_all_interfaces(args.file), args)
+    if args.interfaces:
+            print_interfaces(args.interfaces, args)
 
 def generate(args):
-    from sepolicy.generate import policy, USERS, SANDBOX, APPLICATIONS, NEWTYPE
+    from sepolicy.generate import policy, AUSER, RUSER, EUSER, USERS, SANDBOX, APPLICATIONS, NEWTYPE
     cmd = None
-    if args.policytype not in USERS +  [ SANDBOX, NEWTYPE]:
+# numbers present POLTYPE defined in sepolicy.generate
+    conflict_args = {'TYPES':(NEWTYPE,), 'DOMAIN':(EUSER,), 'ADMIN_DOMAIN':(AUSER, RUSER, EUSER,)}
+    error_text = ""
+
+    if args.policytype is None:
+        generate_usage = generate_custom_usage(usage, usage_dict)
+        for k in usage_dict:
+            error_text += "%s" % (k)
+        print(generate_usage)   
+        print(_("sepolicy generate: error: one of the arguments %s is required") % error_text)
+        sys.exit(1)
+
+    if args.policytype in APPLICATIONS:
         if not args.command:
             raise ValueError(_("Command required for this type of policy"))
         cmd = os.path.realpath(args.command)
@@ -346,8 +484,22 @@ def generate(args):
         mypolicy.set_program(cmd)
 
     if args.types:
+        if args.policytype not in conflict_args['TYPES']:
+            raise ValueError(_("-t option can not be used with '%s' domains. Read usage for more details.") % sepolicy.generate.poltype[args.policytype])
         mypolicy.set_types(args.types)
 
+    if args.domain:
+        if args.policytype not in conflict_args['DOMAIN']:
+            raise ValueError(_("-d option can not be used with '%s' domains. Read usage for more details.") % sepolicy.generate.poltype[args.policytype])
+
+    if args.admin_domain:
+        if args.policytype not in conflict_args['ADMIN_DOMAIN']:
+            raise ValueError(_("-a option can not be used with '%s' domains. Read usage for more details.") % sepolicy.generate.poltype[args.policytype])
+
+    if len(args.writepaths) > 0 and args.policytype == NEWTYPE:
+
+            raise ValueError(_("-w option can not be used with the --newtype option"))
+        
     for p in args.writepaths:
         if os.path.isdir(p):
             mypolicy.add_dir(p)
@@ -355,6 +507,7 @@ def generate(args):
             mypolicy.add_file(p)
 
     mypolicy.set_transition_users(args.user)
+    mypolicy.set_admin_roles(args.role)
     mypolicy.set_admin_domains(args.admin_domain)
     mypolicy.set_existing_domains(args.domain)
 
@@ -366,20 +519,34 @@ def generate(args):
 def gen_interface_args(parser):
     itf = parser.add_parser("interface",
                             help=_('List SELinux Policy interfaces'))
+    itf.add_argument("-c", "--compile", dest="compile",
+                     action="store_true", default=False,
+                     help="Run compile test for selected interface")
+    itf.add_argument("-v", "--verbose", dest="verbose", 
+                     action="store_true", default=False,
+                     help="Show verbose information")
+    itf.add_argument("-f", "--file", dest="file",
+                     help="Interface file")
     group = itf.add_mutually_exclusive_group(required=True)
     group.add_argument("-a", "--list_admin", dest="list_admin",action="store_true",                       default=False,
-                       help="List all domains with admin interface")
+                       help="List all domains with admin interface - DOMAIN_admin()")
     group.add_argument("-u", "--list_user", dest="list_user",action="store_true",
                        default=False,
-                       help="List all domains with SELinux user role interface")
+                       help="List all domains with SELinux user role interface - DOMAIN_role()")
     group.add_argument("-l", "--list", dest="list",action="store_true",
                        default=False,
                        help="List all interfaces")
+    group.add_argument("-i", "--interfaces", nargs="+", dest="interfaces", 
+                       action=InterfaceInfo,
+                       help=_("Enter interface names, you wish to query"))
     itf.set_defaults(func=interface)
 
 def gen_generate_args(parser):
     from sepolicy.generate import DAEMON, get_poltype_desc, poltype, DAEMON, DBUS, INETD, CGI, SANDBOX, USER, EUSER, TUSER, XUSER, LUSER, AUSER, RUSER, NEWTYPE
-    pol = parser.add_parser("generate",
+ 
+    generate_usage = generate_custom_usage(usage, usage_dict)
+
+    pol = parser.add_parser("generate", usage = generate_usage,
                             help=_('Generate SELinux Policy module template'))
     pol.add_argument("-d", "--domain", dest="domain", default=[],
                      action=CheckDomain, nargs="*",
@@ -387,9 +554,12 @@ def gen_generate_args(parser):
     pol.add_argument("-u", "--user", dest="user", default=[],
                      action=CheckUser, 
                      help=_("Enter SELinux user(s) which will transition to this domain"))
+    pol.add_argument("-r", "--role", dest="role", default=[],
+                     action=CheckRole, 
+                     help=_("Enter SELinux role(s) to which the administror domain will transition"))
     pol.add_argument("-a", "--admin", dest="admin_domain",default=[],
                      action=CheckAdmin,
-                     help=_("Enter domain(s) that this confined admin will administrate"))
+                     help=_("Enter domain(s) which this confined admin will administrate"))
     pol.add_argument("-n", "--name", dest="name",
                      default=None,
                      help=_("name of policy to generate"))
@@ -397,53 +567,57 @@ def gen_generate_args(parser):
                      help=argparse.SUPPRESS)
     pol.add_argument("-t", "--type", dest="types", default=[], nargs="*",
                      action=CheckType, 
-                     help=argparse.SUPPRESS)
+                     help="Enter type(s) for which you will generate new definition and rule(s)")
     pol.add_argument("-p", "--path", dest="path", default=os.getcwd(),
                      help=_("path in which the generated policy files will be stored"))
     pol.add_argument("-w", "--writepath", dest="writepaths", nargs="*", default = [],
                      help=_("path to which the confined processes will need to write"))
-    pol.add_argument("command",nargs="?", default=None,
-                     help=_("executable to confine"))
-    group = pol.add_mutually_exclusive_group(required=False)
-    group.add_argument("--newtype", dest="policytype", const=NEWTYPE,
+    cmdtype = pol.add_argument_group(_("Policy types which require a command"))
+    cmdgroup = cmdtype.add_mutually_exclusive_group(required=False)
+    cmdgroup.add_argument("--application", dest="policytype", const=USER,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[NEWTYPE])
-    group.add_argument("--admin_user", dest="policytype", const=AUSER,
+                       help=_("Generate '%s' policy") % poltype[USER])
+    cmdgroup.add_argument("--cgi", dest="policytype", const=CGI,
+                       action="store_const",
+                       help=_("Generate '%s' policy") % poltype[CGI])
+    cmdgroup.add_argument("--dbus", dest="policytype", const=DBUS, 
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[AUSER])
-    group.add_argument("--application", dest="policytype", const=USER,
+                       help=_("Generate '%s' policy") % poltype[DBUS])
+    cmdgroup.add_argument("--inetd", dest="policytype", const=INETD,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[USER])
-    group.add_argument("--cgi", dest="policytype", const=CGI,
+                       help=_("Generate '%s' policy") % poltype[INETD])
+    cmdgroup.add_argument("--init", dest="policytype", const=DAEMON, 
+                       action="store_const", default=DAEMON, 
+                       help=_("Generate '%s' policy") % poltype[DAEMON])
+
+    type = pol.add_argument_group("Policy types which do not require a command")
+    group = type.add_mutually_exclusive_group(required=False)
+    group.add_argument("--admin_user", dest="policytype", const=AUSER,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[CGI])
+                       help=_("Generate '%s' policy") % poltype[AUSER])
     group.add_argument("--confined_admin", dest="policytype", const=RUSER,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[RUSER])
+                       help=_("Generate '%s' policy") % poltype[RUSER])
     group.add_argument("--customize", dest="policytype", const=EUSER,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[EUSER])
-    group.add_argument("--dbus", dest="policytype", const=DBUS, 
-                       action="store_const",
-                       help=_("Generate Policy for %s") % poltype[DBUS])
+                       help=_("Generate '%s' policy") % poltype[EUSER])
     group.add_argument("--desktop_user", dest="policytype", const=LUSER,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[LUSER])
-    group.add_argument("--inetd", dest="policytype", const=INETD,
+                       help=_("Generate '%s' policy ") % poltype[LUSER])
+    group.add_argument("--newtype", dest="policytype", const=NEWTYPE,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[INETD])
-    group.add_argument("--init", dest="policytype", const=DAEMON, 
-                       action="store_const", default=DAEMON, 
-                       help=_("Generate Policy for %s") % poltype[DAEMON])
+                       help=_("Generate '%s' policy") % poltype[NEWTYPE])
     group.add_argument("--sandbox", dest="policytype", const=SANDBOX,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[SANDBOX])
+                       help=_("Generate '%s' policy") % poltype[SANDBOX])
     group.add_argument("--term_user", dest="policytype", const=TUSER,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[TUSER])
+                       help=_("Generate '%s' policy") % poltype[TUSER])
     group.add_argument("--x_user", dest="policytype", const=XUSER,
                        action="store_const",
-                       help=_("Generate Policy for %s") % poltype[XUSER])
+                       help=_("Generate '%s' policy") % poltype[XUSER])
+    pol.add_argument("command",nargs="?", default=None,
+                     help=_("executable to confine"))
     pol.set_defaults(func=generate)
 
 if __name__ == '__main__':
@@ -455,17 +629,26 @@ if __name__ == '__main__':
     gen_booleans_args(subparsers)
     gen_communicate_args(subparsers)
     gen_generate_args(subparsers)
+    gen_gui_args(subparsers)
     gen_interface_args(subparsers)
     gen_manpage_args(subparsers)
     gen_network_args(subparsers)
     gen_transition_args(subparsers)
 
     try:
-        args = parser.parse_args()
+        if os.path.basename(sys.argv[0]) == "sepolgen":
+            args = parser.parse_args([ "generate" ] + sys.argv[1:])
+        else:
+            args = parser.parse_args()
         args.func(args)
         sys.exit(0)
     except ValueError,e:
         sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e)))
         sys.exit(1)
+    except IOError,e:
+        sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e)))
+        sys.exit(1)
     except KeyboardInterrupt:
+        print "Out"
         sys.exit(0)
+
diff --git a/policycoreutils/sepolicy/sepolicy/__init__.py b/policycoreutils/sepolicy/sepolicy/__init__.py
index 5e7415c..6152424 100644
--- a/policycoreutils/sepolicy/sepolicy/__init__.py
+++ b/policycoreutils/sepolicy/sepolicy/__init__.py
@@ -1,12 +1,15 @@
 #!/usr/bin/python
 
-# Author: Thomas Liu <tliu@redhat.com>
 # Author: Dan Walsh <dwalsh@redhat.com>
+# Author: Ryan Hallisey <rhallise@redhat.com>
 
 import _policy
 import selinux, glob
 PROGNAME="policycoreutils"
 import gettext
+import sepolgen.defaults as defaults
+import sepolgen.interfaces as interfaces
+import sys
 gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
 gettext.textdomain(PROGNAME)
 try:
@@ -37,16 +40,385 @@ CLASS = 'class'
 TRANSITION = 'transition'
 ROLE_ALLOW = 'role_allow'
 
-def __get_installed_policy():
+def info(setype, name=None):
+    dict_list = _policy.info(setype, name)
+    return dict_list
+
+def search(types, info = {}):
+    seinfo = info
+    valid_types = [ALLOW, AUDITALLOW, NEVERALLOW, DONTAUDIT, TRANSITION, ROLE_ALLOW]
+    for setype in types:
+        if setype not in valid_types:
+            raise ValueError("Type has to be in %s" % valid_types)
+        seinfo[setype] = True
+
+    perms = []
+    if PERMS in seinfo:
+        perms = info[PERMS]
+        seinfo[PERMS] = ",".join(seinfo[PERMS])
+
+    dict_list = _policy.search(seinfo)
+    if dict_list and len(perms) != 0:
+        dict_list = filter(lambda x: _dict_has_perms(x, perms), dict_list)
+    return dict_list
+
+def get_conditionals(src,dest,tclass,perm):
+    tdict = {}
+    tlist = []
+    if dest.endswith("_t"):
+        allows=search([ALLOW],{SOURCE:src,TARGET:dest,CLASS:tclass,PERMS:perm})
+    else:
+        # to include attribute
+        allows=search([ALLOW],{SOURCE:src,CLASS:tclass,PERMS:perm})
+        for i in allows:
+            if i['target'] == dest:
+                allows=[]
+                allows.append(i)
+    try:
+        for i in map(lambda y: (y), filter(lambda x: set(perm).issubset(x[PERMS]) and x['boolean'], allows)):
+            tdict.update({'source':i['source'],'boolean':i['boolean']})
+            if tdict not in tlist:
+                tlist.append(tdict)
+                tdict={}
+    except KeyError:
+        return(tlist)
+
+    return (tlist)
+
+def get_conditionals_format_text(cond):
+    enabled = len(filter(lambda x: x['boolean'][0][1], cond)) > 0
+    return _("-- Allowed %s [ %s ]") % (enabled, " || ".join(set(map(lambda x: "%s=%d" % (x['boolean'][0][0], x['boolean'][0][1]), cond))))
+
+def get_types_from_attribute(attribute):
+    return info(ATTRIBUTE,attribute)[0]["types"]
+
+file_type_str = {}
+file_type_str["a"] = _("all files")
+file_type_str["f"] = _("regular file")
+file_type_str["d"] = _("directory")
+file_type_str["c"] = _("character device")
+file_type_str["b"] = _("block device")
+file_type_str["s"] = _("socket file")
+file_type_str["l"] = _("symbolic link")
+file_type_str["p"] = _("named pipe")
+
+trans_file_type_str = {}
+trans_file_type_str[""] = "a"
+trans_file_type_str["--"] = "f"
+trans_file_type_str["-d"] = "d"
+trans_file_type_str["-c"] = "c"
+trans_file_type_str["-b"] = "b"
+trans_file_type_str["-s"] = "s"
+trans_file_type_str["-l"] = "l"
+trans_file_type_str["-p"] = "p"
+
+def get_file_types(setype):
+    flist=[]
+    mpaths={}
+    for f in get_all_file_types():
+        if f.startswith(gen_short_name(setype)):
+            flist.append(f)
+    fcdict = get_fcdict()
+    for f in flist:
+        try:
+            mpaths[f] = (fcdict[f]["regex"], file_type_str[fcdict[f]["ftype"]])
+        except KeyError:
+            mpaths[f] = []
+    return mpaths
+
+def get_writable_files(setype):
+    all_attributes = get_all_attributes()
+    file_types = get_all_file_types()
+    all_writes = []
+    mpaths = {}
+    permlist = search([ALLOW],{'source':setype,  'permlist':['open', 'write'], 'class':'file'})
+    if permlist == None or len(permlist) == 0:
+        return mpaths
+
+    fcdict = get_fcdict()
+
+    attributes = ["proc_type", "sysctl_type"]
+    for i in permlist:
+        if i['target'] in attributes:
+            continue
+        if i['target'].endswith("_t"):
+            if i['target'] not in file_types:
+                continue
+            if i['target'] not in all_writes:
+                if i['target'] != setype:
+                    all_writes.append(i['target'])
+        else:
+            for t in get_types_from_attribute(i['target']):
+                if t not in all_writes:
+                    all_writes.append(t)
+
+    for f in all_writes:
+        try:
+            mpaths[f] = (fcdict[f]["regex"], file_type_str[fcdict[f]["ftype"]])
+        except KeyError:
+            mpaths[f] = [] #{"regex":[],"paths":[]}
+    return mpaths
+
+import os, re, sys
+def find_file(reg):
+    if os.path.exists(reg):
+        return [ reg ]
+    try:
+        pat = re.compile(r"%s$" % reg)
+    except:
+        print "bad reg:", reg
+        return []
+    p = reg
+    if p.endswith("(/.*)?"):
+        p = p[:-6] + "/"
+
+    path = os.path.dirname(p)
+
+    try:                       # Bug fix: when "all files on system"
+        if path[-1] != "/":    # is pass in it breaks without try block
+            path += "/"
+    except IndexError:
+        print "try failed got an IndexError"
+        pass
+
+    try:
+        pat = re.compile(r"%s$" % reg)
+        return filter(pat.match, map(lambda x: path + x, os.listdir(path)))
+    except:
+        return []
+
+def find_all_files(domain, exclude_list = []):
+    all_entrypoints = []
+    executable_files = get_entrypoints(domain)
+    for exe in executable_files.keys():
+        if exe.endswith("_exec_t") and exe not in exclude_list:
+            for path in executable_files[exe]:
+                for f in find_file(path):
+                    return f
+                    #all_entrypoints.append(f)
+    return None
+
+#return all_entrypoints
+def find_entrypoint_path(exe, exclude_list = []):
+    fcdict = get_fcdict()
+    try:
+        if exe.endswith("_exec_t") and exe not in exclude_list:
+            for path in fcdict[exe]["regex"]:
+                for f in find_file(path):
+                    return f
+    except KeyError:
+        pass
+    return None
+
+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 }
+        return edict
+    
+file_equiv_modified=None
+def get_file_equiv_modified(fc_path = selinux.selinux_file_context_path()):
+        global file_equiv_modified
+        if file_equiv_modified:
+                return file_equiv_modified
+        file_equiv_modified = {}
+        file_equiv_modified = read_file_equiv(file_equiv_modified, fc_path + ".subs", modify=True)
+        return file_equiv_modified
+
+file_equiv=None
+def get_file_equiv(fc_path = selinux.selinux_file_context_path()):
+        global file_equiv
+        if file_equiv:
+                return file_equiv
+        file_equiv = get_file_equiv_modified(fc_path)
+        file_equiv = read_file_equiv(file_equiv, fc_path + ".subs_dist", modify = False)
+        return file_equiv
+        
+local_files=None
+def get_local_file_paths(fc_path = selinux.selinux_file_context_path()):
+    global local_files
+    if local_files:
+        return local_files
+    local_files=[]
+    fd = open(fc_path+".local", "r")
+    fc = fd.readlines()
+    fd.close()
+    for i in fc:
+        rec = i.split()
+        if len(rec) == 0:
+            continue
+        try:
+            if len(rec) > 2:
+                ftype = trans_file_type_str[rec[1]]
+            else:
+                ftype = "a"
+
+            local_files.append((rec[0], ftype))
+        except KeyError:
+            pass
+    return local_files
+
+fcdict=None
+def get_fcdict(fc_path = selinux.selinux_file_context_path()):
+    global fcdict
+    if fcdict:
+        return fcdict
+    fd = open(fc_path, "r")
+    fc = fd.readlines()
+    fd.close()
+    fd = open(fc_path+".homedirs", "r")
+    fc += fd.readlines()
+    fd.close()
+    fcdict = {}
+    fd = open(fc_path+".local", "r")
+    fc += fd.readlines()
+    fd.close()
+
+    for i in fc:
+        rec = i.split()
+        try:
+            if len(rec) > 2:
+                ftype = trans_file_type_str[rec[1]]
+            else:
+                ftype = "a"
+
+            t = rec[-1].split(":")[2]
+            if t in fcdict:
+                fcdict[t]["regex"].append(rec[0])
+            else:
+                fcdict[t] = { "regex": [ rec[0] ], "ftype": ftype}
+        except:
+            pass
+
+    fcdict["logfile"] = { "regex" : [ "all log files" ]}
+    fcdict["user_tmp_type"] = { "regex" : [ "all user tmp files" ]}
+    fcdict["user_home_type"] = { "regex" : [ "all user home files" ]}
+    fcdict["virt_image_type"] = { "regex" : [ "all virtual image files" ]}
+    fcdict["noxattrfs"] = { "regex" : [ "all files on file systems which do not support extended attributes" ]}
+    fcdict["sandbox_tmpfs_type"] = { "regex" : [ "all sandbox content in tmpfs file systems" ]}
+    fcdict["user_tmpfs_type"] = { "regex" : [ "all user content in tmpfs file systems" ]}
+    fcdict["file_type"] = { "regex" : [ "all files on the system" ]}
+    fcdict["samba_share_t"] = { "regex" : [ "use this label for random content that will be shared using samba" ]}
+    return fcdict
+
+def get_transitions_into(setype):
+    try:
+        return filter(lambda x: x["transtype"] == setype, search([TRANSITION],{ 'class':'process'}))
+    except TypeError:
+        pass
+    return None
+
+def get_transitions(setype):
+    try:
+        return search([TRANSITION],{'source':setype, 'class':'process'})
+    except TypeError:
+        pass
+    return None
+
+def get_file_transitions(setype):
+    try:
+        return filter(lambda x: x['class'] != "process", search([TRANSITION],{'source':setype}))
+    except TypeError:
+        pass
+    return None
+
+def get_boolean_rules(setype, boolean):
+    boollist = []
+    permlist = search([ALLOW],{'source':setype })
+    for p in permlist:
+        if "boolean" in p:
+            try:
+                for b in p["boolean"]:
+                    if boolean in b:
+                        boollist.append(p)
+            except:
+                pass
+    return boollist
+
+def get_all_entrypoints():
+    return get_types_from_attribute("entry_type")
+
+def get_entrypoint_types(setype):
+    entrypoints = []
+    try:
+        entrypoints = map(lambda x: x['target'],filter(lambda x: x['source'] == setype, search([ALLOW],{'source':setype,  'permlist':['entrypoint'], 'class':'file'})))
+    except TypeError:
+        pass
+    return entrypoints
+
+def get_init_transtype(path):
+    entrypoint = selinux.getfilecon(path)[1].split(":")[2]
+    try:
+        entrypoints = filter(lambda x: x['target'] == entrypoint, search([TRANSITION],{'source':"init_t", 'class':'process'}))
+        if len(entrypoints) == 0:
+            return None
+        return entrypoints[0]["transtype"]
+    except TypeError:
+        pass
+    return None
+
+def get_init_entrypoint(transtype):
+    try:
+        entrypoints = filter(lambda x: x['transtype'] == transtype, search([TRANSITION],{'source':"init_t", 'class':'process'}))
+        if len(entrypoints) == 0:
+            return None
+        return entrypoints[0]["target"]
+    except TypeError:
+        pass
+    return None
+
+def get_init_entrypoint_target(entrypoint):
     try:
-        path = selinux.selinux_binary_policy_path()
+        entrypoints = map(lambda x: x['transtype'], search([TRANSITION],{'source':"init_t",  'target':entrypoint, 'class':'process'}))
+        return entrypoints[0]
+    except TypeError:
+        pass
+    return None
+
+def get_entrypoints(setype):
+    fcdict = get_fcdict()
+    mpaths = {}
+    for f in get_entrypoint_types(setype):
+        try:
+            mpaths[f] = (fcdict[f]["regex"], file_type_str[fcdict[f]["ftype"]])
+        except KeyError:
+            mpaths[f] = []
+    return mpaths
+
+def get_installed_policy(root = "/"):
+    try:
+        path = root + selinux.selinux_binary_policy_path()
         policies = glob.glob ("%s.*" % path )
         policies.sort()
         return policies[-1]
     except:
         pass
     raise ValueError(_("No SELinux Policy installed"))
-        
+
+methods = []
+def get_methods():
+    global methods
+    if len(methods) > 0:
+        return methods
+    gen_interfaces()
+    fn = defaults.interface_info()
+    try:
+        fd = open(fn)
+    # List of per_role_template interfaces
+        ifs = interfaces.InterfaceSet()
+        ifs.from_file(fd)
+        methods = ifs.interfaces.keys()
+        fd.close()
+    except:
+        sys.stderr.write("could not open interface info [%s]\n" % fn)
+        sys.exit(1)
+
+    methods.sort()
+    return methods
+
 all_types = None
 def get_all_types():
     global all_types
@@ -54,23 +426,31 @@ def get_all_types():
         all_types = map(lambda x: x['name'], info(TYPE))
     return all_types
 
+user_types =  None
+def get_user_types():
+    global user_types
+    if user_types == None:
+        user_types = info(ATTRIBUTE,"userdomain")[0]["types"]
+    return user_types
+
 role_allows = None
 def get_all_role_allows():
-	global role_allows
-	if role_allows:
-		return role_allows
-	role_allows = {}
-	for r in search([ROLE_ALLOW]):
-		if r["source"] == "system_r" or r["target"] == "system_r":
-			continue
-		if r["source"] in role_allows:
-			role_allows[r["source"]].append(r["target"])
-		else:
-			role_allows[r["source"]] = [ r["target"] ]
-
-	return role_allows
+        global role_allows
+        if role_allows:
+                return role_allows
+        role_allows = {}
+        for r in search([ROLE_ALLOW]):
+                if r["source"] == "system_r" or r["target"] == "system_r":
+                        continue
+                if r["source"] in role_allows:
+                        role_allows[r["source"]].append(r["target"])
+                else:
+                        role_allows[r["source"]] = [ r["target"] ]
+
+        return role_allows
 
 def get_all_entrypoint_domains():
+    import re
     all_domains = []
     types=get_all_types()
     types.sort()
@@ -81,138 +461,366 @@ def get_all_entrypoint_domains():
                 all_domains.append(m[0])
     return all_domains
 
+portrecs = None
+portrecsbynum = None
+
+def gen_interfaces():
+    import commands
+    ifile = defaults.interface_info()
+    headers = defaults.headers()
+    rebuild = False
+    try:
+        if os.stat(headers).st_mtime <= os.stat(ifile).st_mtime:
+            return
+    except OSError:
+        pass
+
+    if os.getuid() != 0:
+        raise ValueError(_("You must regenerate interface info by running /usr/bin/sepolgen-ifgen"))
+    print commands.getstatusoutput("/usr/bin/sepolgen-ifgen")[1]
+
+def gen_port_dict():
+    global portrecs
+    global portrecsbynum
+    if portrecs:
+        return ( portrecs, portrecsbynum )
+    portrecsbynum = {}
+    portrecs = {}
+    for i in info(PORT):
+        if i['low'] == i['high']:
+            port = str(i['low'])
+        else:
+            port = "%s-%s" % (str(i['low']), str(i['high']))
+
+        if (i['type'], i['protocol']) in portrecs:
+            portrecs [(i['type'], i['protocol'])].append(port)
+        else:
+            portrecs [(i['type'], i['protocol'])] = [port]
+
+        if 'range' in i:
+            portrecsbynum[(i['low'], i['high'],i['protocol'])] = (i['type'], i['range'])
+        else:
+            portrecsbynum[(i['low'], i['high'],i['protocol'])] = (i['type'])
+
+    return ( portrecs, portrecsbynum )
+
 all_domains = None
 def get_all_domains():
-	global all_domains
-	if not all_domains:
-		all_domains = info(ATTRIBUTE,"domain")[0]["types"]
-	return all_domains
+        global all_domains
+        if not all_domains:
+            all_domains = info(ATTRIBUTE,"domain")[0]["types"]
+        return all_domains
 
 roles = None
 def get_all_roles():
-	global roles
-	if roles:
-		return roles
+        global roles
+        if roles:
+                return roles
         roles = map(lambda x: x['name'], info(ROLE))
         roles.remove("object_r")
         roles.sort()
         return roles
 
-users = None
+selinux_user_list = None
+def get_selinux_users():
+    global selinux_user_list
+    if not selinux_user_list:
+        selinux_user_list = info(USER)
+        for x in selinux_user_list:
+            x['range']="".join(x['range'].split(" "))
+    return selinux_user_list
+
+login_mappings = None
+def get_login_mappings():
+    global login_mappings
+    if login_mappings:
+        return login_mappings
+
+    fd = open(selinux.selinux_usersconf_path(), "r")
+    buf=fd.read()
+    fd.close()
+    login_mappings = []
+    for b in  buf.split("\n"):
+        b = b.strip()
+        if len(b) == 0 or b.startswith("#"):
+            continue
+        x = b.split(":")
+        login_mappings.append({ "name": x[0], "seuser": x[1], "mls":":".join(x[2:])})
+    return login_mappings
+
 def get_all_users():
-    global users
-    if users:
-        return users
-    users = map(lambda x: x['name'], info(USER))
-    return users 
+    users = map(lambda x: x['name'], get_selinux_users())
+    users.sort()
+    return users
 
 file_types = None
 def get_all_file_types():
-	global file_types
-	if file_types:
-		return file_types
-	file_types =  info(ATTRIBUTE,"file_type")[0]["types"]
-	file_types.sort()
-	return file_types
+        global file_types
+        if file_types:
+                return file_types
+        file_types =  info(ATTRIBUTE,"file_type")[0]["types"]
+        file_types.sort()
+        return file_types
 
 port_types = None
 def get_all_port_types():
-	global port_types
-	if port_types:
-		return port_types
-	port_types =  info(ATTRIBUTE,"port_type")[0]["types"]
-	port_types.sort()
-	return port_types
+        global port_types
+        if port_types:
+                return port_types
+        port_types =  info(ATTRIBUTE,"port_type")[0]["types"]
+        port_types.sort()
+        return port_types
 
 bools = None
 def get_all_bools():
-	global bools
-	if not bools:
-		bools = info(BOOLEAN)
-	return bools
+        global bools
+        if not bools:
+                bools = info(BOOLEAN)
+        return bools
+
+def prettyprint(f,trim):
+    return " ".join(f[:-len(trim)].split("_"))
+
+def markup(f):
+    return f
+
+# Autofill for adding files *************************
+DEFAULT_DIRS = {}
+DEFAULT_DIRS["/etc"] = "etc_t"
+DEFAULT_DIRS["/tmp"] = "tmp_t"
+DEFAULT_DIRS["/usr/lib/systemd/system"] = "unit_file_t"
+DEFAULT_DIRS["/lib/systemd/system"] = "unit_file_t"
+DEFAULT_DIRS["/etc/systemd/system"] = "unit_file_t"
+DEFAULT_DIRS["/var/cache"] = "var_cache_t"
+DEFAULT_DIRS["/var/lib"] = "var_lib_t"
+DEFAULT_DIRS["/var/log"] = "log_t"
+DEFAULT_DIRS["/var/run"] = "var_run_t"
+DEFAULT_DIRS["/run"] = "var_run_t"
+DEFAULT_DIRS["/run/lock"] = "var_lock_t"
+DEFAULT_DIRS["/var/run/lock"] = "var_lock_t"
+DEFAULT_DIRS["/var/spool"] = "var_spool_t"
+DEFAULT_DIRS["/var/www"] = "content_t"
+
+def get_description(f, markup=markup):
+
+    txt = "Set files with the %s type, if you want to " % markup(f)
+
+    if f.endswith("_var_run_t"):
+        return txt +  "store the %s files under the /run or /var/run directory." % prettyprint(f, "_var_run_t")
+    if f.endswith("_pid_t"):
+        return txt +  "store the %s files under the /run directory." % prettyprint(f, "_pid_t")
+    if f.endswith("_var_lib_t"):
+        return txt +  "store the %s files under the /var/lib directory."  % prettyprint(f, "_var_lib_t")
+    if f.endswith("_var_t"):
+        return txt +  "store the %s files under the /var directory."  % prettyprint(f, "_var_lib_t")
+    if f.endswith("_var_spool_t"):
+        return txt +  "store the %s files under the /var/spool directory." % prettyprint(f, "_spool_t")
+    if f.endswith("_spool_t"):
+        return txt +  "store the %s files under the /var/spool directory." % prettyprint(f, "_spool_t")
+    if f.endswith("_cache_t") or f.endswith("_var_cache_t"):
+        return txt +  "store the files under the /var/cache directory."
+    if f.endswith("_keytab_t"):
+        return txt +  "treat the files as kerberos keytab files."
+    if f.endswith("_lock_t"):
+        return txt +  "treat the files as %s lock data, stored under the /var/lock directory" % prettyprint(f,"_lock_t")
+    if f.endswith("_log_t"):
+        return txt +  "treat the data as %s log data, usually stored under the /var/log directory." % prettyprint(f,"_log_t")
+    if f.endswith("_config_t"):
+        return txt +  "treat the files as %s configuration data, usually stored under the /etc directory." % prettyprint(f,"_config_t")
+    if f.endswith("_conf_t"):
+        return txt +  "treat the files as %s configuration data, usually stored under the /etc directory." % prettyprint(f,"_conf_t")
+    if f.endswith("_exec_t"):
+        return txt +  "transition an executable to the %s_t domain." % f[:-len("_exec_t")]
+    if f.endswith("_cgi_content_t"):
+        return txt +  "treat the files as %s cgi content." % prettyprint(f, "_cgi_content_t")
+    if f.endswith("_rw_content_t"):
+        return txt +  "treat the files as %s read/write content." % prettyprint(f,"_rw_content_t")
+    if f.endswith("_rw_t"):
+        return txt +  "treat the files as %s read/write content." % prettyprint(f,"_rw_t")
+    if f.endswith("_write_t"):
+        return txt +  "treat the files as %s read/write content." % prettyprint(f,"_write_t")
+    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")
+    if f.endswith("_cert_t"):
+        return txt +  "treat the files as %s certificate data." % prettyprint(f,"_cert_t")
+    if f.endswith("_key_t"):
+        return txt +  "treat the files as %s key data." % prettyprint(f,"_key_t")
+
+    if f.endswith("_secret_t"):
+        return txt +  "treat the files as %s secret data." % prettyprint(f,"_key_t")
+
+    if f.endswith("_ra_t"):
+        return txt +  "treat the files as %s read/append content." % prettyprint(f,"_ra_t")
+
+    if f.endswith("_ro_t"):
+        return txt +  "treat the files as %s read/only content." % prettyprint(f,"_ro_t")
+
+    if f.endswith("_modules_t"):
+        return txt +  "treat the files as %s modules." % prettyprint(f, "_modules_t")
+
+    if f.endswith("_content_t"):
+        return txt +  "treat the files as %s content." % prettyprint(f, "_content_t")
+
+    if f.endswith("_state_t"):
+        return txt +  "treat the files as %s state data." % prettyprint(f, "_state_t")
+
+    if f.endswith("_files_t"):
+        return txt +  "treat the files as %s content." % prettyprint(f, "_files_t")
+
+    if f.endswith("_file_t"):
+        return txt +  "treat the files as %s content." % prettyprint(f, "_file_t")
+
+    if f.endswith("_data_t"):
+        return txt +  "treat the files as %s content." % prettyprint(f, "_data_t")
+
+    if f.endswith("_file_t"):
+        return txt +  "treat the data as %s content." % prettyprint(f, "_file_t")
+
+    if f.endswith("_tmp_t"):
+        return txt +  "store %s temporary files in the /tmp directories." % prettyprint(f, "_tmp_t")
+    if f.endswith("_etc_t"):
+        return txt +  "store %s files in the /etc directories." % prettyprint(f, "_tmp_t")
+    if f.endswith("_home_t"):
+        return txt +  "store %s files in the users home directory." % prettyprint(f, "_home_t")
+    if f.endswith("_tmpfs_t"):
+        return txt +  "store %s files on a tmpfs file system." % prettyprint(f, "_tmpfs_t")
+    if f.endswith("_unit_file_t"):
+        return txt +  "treat files as a systemd unit file."
+    if f.endswith("_htaccess_t"):
+        return txt +  "treat the file as a %s access file." % prettyprint(f, "_htaccess_t")
+
+    return txt +  "treat the files as %s data." % prettyprint(f,"_t")
 
 all_attributes = None
 def get_all_attributes():
-	global all_attributes
-	if not all_attributes:
-		all_attributes = map(lambda x: x['name'], info(ATTRIBUTE))
-	return all_attributes
+        global all_attributes
+        if not all_attributes:
+                all_attributes = map(lambda x: x['name'], info(ATTRIBUTE))
+        return all_attributes
 
 def policy(policy_file):
+    global all_domains
+    global all_attributes
+    global bools
+    global all_types
+    global role_allows
+    global users
+    global roles
+    global file_types
+    global port_types
+    all_domains = None
+    all_attributes = None
+    bools = None
+    all_types = None
+    role_allows = None
+    users = None
+    roles = None
+    file_types = None
+    port_types = None
     try:
         _policy.policy(policy_file)
     except:
         raise ValueError(_("Failed to read %s policy file") % policy_file)
 
-
-policy_file = selinux.selinux_current_policy_path()
-if not policy_file:
-    policy_file = __get_installed_policy()
-
 try:
+    policy_file = get_installed_policy()
     policy(policy_file)
 except ValueError, e:
     if selinux.is_selinux_enabled() == 1:
         raise e
 
-def search(types, info = {} ):
-    valid_types = [ALLOW, AUDITALLOW, NEVERALLOW, DONTAUDIT, TRANSITION, ROLE_ALLOW]
-    for type in types:
-        if type not in valid_types:
-            raise ValueError("Type has to be in %s" % valid_types)
-        info[type] = True
-
-    perms = []
-    if PERMS in info:
-        perms = info[PERMS]
-        info[PERMS] = ",".join(info[PERMS])
-
-    dict_list = _policy.search(info)
-    if dict_list and len(perms) != 0:
-        dict_list = filter(lambda x: _dict_has_perms(x, perms), dict_list)
-    return dict_list
-
 def _dict_has_perms(dict, perms):
     for perm in perms:
         if perm not in dict[PERMS]:
             return False
     return True
 
-def info(setype, name=None):
-    dict_list = _policy.info(setype, name)
-    return dict_list
+def gen_short_name(setype):
+    all_domains = get_all_domains()
+    if setype.endswith("_t"):
+        domainname = setype[:-2]
+    else:
+        domainname = setype
+    if domainname + "_t" not in all_domains:
+        raise  ValueError("domain %s_t does not exist" % domainname)
+    if domainname[-1]=='d':
+        short_name = domainname[:-1] + "_"
+    else:
+        short_name = domainname + "_"
+    return (domainname, short_name)
+
+def get_bools(setype):
+    bools = []
+    domainbools = []
+    domainname, short_name = gen_short_name(setype)
+    for i in map(lambda x: x['boolean'], filter(lambda x: 'boolean' in x, search([ALLOW],{'source' : setype}))):
+        for b in i:
+            if not isinstance(b,tuple):
+                continue
+            try:
+                enabled = selinux.security_get_boolean_active(b[0])
+            except OSError:
+                enabled = b[1]
+            if b[0].startswith(short_name) or b[0].startswith(domainname):
+                if (b[0], enabled) not in domainbools and (b[0], not enabled) not in domainbools:
+                    domainbools.append((b[0], enabled))
+            else:
+                if (b[0], enabled) not in bools and (b[0], not enabled) not in bools:
+                    bools.append((b[0],enabled))
+    return (domainbools, bools)
+
+booleans = None
+def get_all_booleans():
+    global booleans
+    if not booleans:
+        booleans = selinux.security_get_boolean_names()[1]
+    return booleans
 
 booleans_dict = None
+import gzip
+def policy_xml(path="/usr/share/selinux/devel/policy.xml"):
+    try:
+        fd = gzip.open(path)
+        buf = fd.read()
+        fd.close()
+    except IOError:
+        fd = open(path)
+        buf = fd.read()
+        fd.close()
+    return buf
+
 def gen_bool_dict(path="/usr/share/selinux/devel/policy.xml"):
         global booleans_dict
         if booleans_dict:
             return booleans_dict
-	import xml.etree.ElementTree
-	import re
-	booleans_dict = {}
-	try:
-		tree = xml.etree.ElementTree.parse(path)
-		for l in  tree.findall("layer"):
-			for m in  l.findall("module"):
-				for b in  m.findall("tunable"):
-					desc = b.find("desc").find("p").text.strip("\n")
-					desc = re.sub("\n", " ", desc)
-					booleans_dict[b.get('name')] = (m.get("name"), b.get('dftval'), desc)
-				for b in  m.findall("bool"):
-					desc = b.find("desc").find("p").text.strip("\n")
-					desc = re.sub("\n", " ", desc)
-					booleans_dict[b.get('name')] = (m.get("name"), b.get('dftval'), desc)
-			for i in  tree.findall("bool"):
-				desc = i.find("desc").find("p").text.strip("\n")
-				desc = re.sub("\n", " ", desc)
-				booleans_dict[i.get('name')] = ("global", i.get('dftval'), desc)
-		for i in  tree.findall("tunable"):
-			desc = i.find("desc").find("p").text.strip("\n")
-			desc = re.sub("\n", " ", desc)
-			booleans_dict[i.get('name')] = ("global", i.get('dftval'), desc)
-	except IOError, e:
-		pass
-	return booleans_dict
+        import xml.etree.ElementTree
+        import re
+        booleans_dict = {}
+        try:
+                tree = xml.etree.ElementTree.fromstring(policy_xml(path))
+                for l in  tree.findall("layer"):
+                        for m in  l.findall("module"):
+                                for b in  m.findall("tunable"):
+                                        desc = b.find("desc").find("p").text.strip("\n")
+                                        desc = re.sub("\n", " ", desc)
+                                        booleans_dict[b.get('name')] = (m.get("name"), b.get('dftval'), desc)
+                                for b in  m.findall("bool"):
+                                        desc = b.find("desc").find("p").text.strip("\n")
+                                        desc = re.sub("\n", " ", desc)
+                                        booleans_dict[b.get('name')] = (m.get("name"), b.get('dftval'), desc)
+                        for i in  tree.findall("bool"):
+                                desc = i.find("desc").find("p").text.strip("\n")
+                                desc = re.sub("\n", " ", desc)
+                                booleans_dict[i.get('name')] = ("global", i.get('dftval'), desc)
+                for i in  tree.findall("tunable"):
+                        desc = i.find("desc").find("p").text.strip("\n")
+                        desc = re.sub("\n", " ", desc)
+                        booleans_dict[i.get('name')] = ("global", i.get('dftval'), desc)
+        except IOError, e:
+                pass
+        return booleans_dict
 
 def boolean_category(boolean):
     booleans_dict = gen_bool_dict()
@@ -233,18 +841,58 @@ def get_os_version():
     os_version = ""
     pkg_name = "selinux-policy"
     try:
-	import commands
-	rc, output = commands.getstatusoutput("rpm -q '%s'" % pkg_name)
-	if rc == 0:
-	    os_version = output.split(".")[-2]
+        import commands
+        rc, output = commands.getstatusoutput("rpm -q '%s'" % pkg_name)
+        if rc == 0:
+            os_version = output.split(".")[-2]
     except:
-	os_version = ""
+        os_version = ""
 
     if os_version[0:2] == "fc":
-	os_version = "Fedora"+os_version[2:]
+        os_version = "Fedora"+os_version[2:]
     elif os_version[0:2] == "el":
-	os_version = "RHEL"+os_version[2:]
+        os_version = "RHEL"+os_version[2:]
     else:
-	os_version = ""
+        os_version = ""
 
     return os_version
+
+def reinit():
+    global all_attributes
+    global all_domains
+    global all_types
+    global booleans
+    global booleans_dict
+    global bools
+    global fcdict
+    global file_types
+    global local_files
+    global methods
+    global methods    
+    global portrecs
+    global portrecsbynum
+    global port_types
+    global role_allows
+    global roles
+    global login_mappings
+    global selinux_user_list
+    global user_types
+    all_attributes = None
+    all_domains = None
+    all_types = None
+    booleans = None
+    booleans_dict = None
+    bools = None
+    fcdict = None
+    file_types = None
+    local_files=None
+    methods = None
+    methods = None
+    portrecs = None
+    portrecsbynum = None
+    port_types = None
+    role_allows = None
+    roles = None
+    user_types = None
+    login_mappings = None
+    selinux_user_list = None
diff --git a/policycoreutils/sepolicy/sepolicy/communicate.py b/policycoreutils/sepolicy/sepolicy/communicate.py
index a179d95..9b9a09a 100755
--- a/policycoreutils/sepolicy/sepolicy/communicate.py
+++ b/policycoreutils/sepolicy/sepolicy/communicate.py
@@ -40,7 +40,7 @@ def expand_attribute(attribute):
 def get_types(src, tclass, perm):
     allows=search([sepolicy.ALLOW],{sepolicy.SOURCE:src,sepolicy.CLASS:tclass, sepolicy.PERMS:perm})
     if not allows:
-        raise TypeError("The %s type is not allowed to %s any types" % (src, ",".join(perm)))
+        raise ValueError("The %s type is not allowed to %s any types" % (src, ",".join(perm)))
 
     tlist = []
     for l in map(lambda y: y[sepolicy.TARGET], filter(lambda x: set(perm).issubset(x[sepolicy.PERMS]), allows)):
diff --git a/policycoreutils/sepolicy/sepolicy/generate.py b/policycoreutils/sepolicy/sepolicy/generate.py
index 26f8390..ba959ae 100644
--- a/policycoreutils/sepolicy/sepolicy/generate.py
+++ b/policycoreutils/sepolicy/sepolicy/generate.py
@@ -63,20 +63,6 @@ except IOError:
     import __builtin__
     __builtin__.__dict__['_'] = unicode
 
-user_types =  sepolicy.info(sepolicy.ATTRIBUTE,"userdomain")[0]["types"]
-methods = []
-fn = defaults.interface_info()
-try:
-    fd = open(fn)
-    # List of per_role_template interfaces
-    ifs = interfaces.InterfaceSet()
-    ifs.from_file(fd)
-    methods = ifs.interfaces.keys()
-    fd.close()
-except:
-    sys.stderr.write("could not open interface info [%s]\n" % fn)
-    sys.exit(1)
-
 def get_rpm_nvr_from_header(hdr):
     'Given an RPM header return the package NVR as a string'
     name    = hdr['name']
@@ -164,7 +150,7 @@ def get_poltype_desc():
     return msg
         
 APPLICATIONS = [ DAEMON, DBUS, INETD, USER, CGI ]
-USERS = [ XUSER, TUSER, LUSER, AUSER, EUSER, RUSER]
+USERS = [ XUSER, TUSER, LUSER, AUSER, RUSER]
 
 def verify_ports(ports):
     if ports == "":
@@ -206,7 +192,7 @@ class policy:
                     raise ValueError(_("You must enter a valid policy type"))
 
 		if not name:
-                    raise ValueError(_("You must enter a name for your policy module for your %s.") % poltype[type])
+                    raise ValueError(_("You must enter a name for your policy module for your '%s'.") % poltype[type])
                 try:
                     self.ports = get_all_ports()
                 except ValueError, e:
@@ -268,8 +254,14 @@ class policy:
                 self.symbols["fowner"] = "add_capability('fowner')"
                 self.symbols["fsetid"] = "add_capability('fsetid')"
                 self.symbols["setgid"] = "add_capability('setgid')"
+                self.symbols["setegid"] = "add_capability('setgid')"
+                self.symbols["setresgid"] = "add_capability('setgid')"
+                self.symbols["setregid"] = "add_capability('setgid')"
                 self.symbols["setresuid"] = "add_capability('setuid')"
                 self.symbols["setuid"] = "add_capability('setuid')"
+                self.symbols["seteuid"] = "add_capability('setuid')"
+                self.symbols["setreuid"] = "add_capability('setuid')"
+                self.symbols["setresuid"] = "add_capability('setuid')"
                 self.symbols["setpcap"] = "add_capability('setpcap')"
                 self.symbols["linux_immutable"] = "add_capability('linux_immutable')"
                 self.symbols["net_bind_service"] = "add_capability('net_bind_service')"
@@ -319,7 +311,7 @@ class policy:
 		self.DEFAULT_EXT["_var_log_t"] = var_log;
 		self.DEFAULT_EXT["_var_run_t"] = var_run;
 		self.DEFAULT_EXT["_var_spool_t"] = var_spool;
-		self.DEFAULT_EXT["port_t"] = network;
+		self.DEFAULT_EXT["_port_t"] = network;
 
                 self.DEFAULT_KEYS=["/etc", "/var/cache", "/var/log", "/tmp", "rw", "/var/lib", "/var/run", "/var/spool", "/etc/systemd/system", "/usr/lib/systemd/system", "/lib/systemd/system" ]
 
@@ -587,7 +579,7 @@ class policy:
         def generate_network_action(self, protocol, action, port_name):
             line = ""
             method = "corenet_%s_%s_%s" % (protocol, action, port_name)
-            if method in methods:
+            if method in sepolicy.get_methods():
                 line = "%s(%s_t)\n" % (method, self.name)
             else:
                 line = """
@@ -843,7 +835,7 @@ allow %s_t %s_t:%s_socket name_%s;
 
 	def generate_existing_user_types(self):
                 if len(self.existing_domains) == 0:
-                    raise ValueError(_("%s policy modules require existing domains") % poltype[self.type])
+                    raise ValueError(_("'%s' policy modules require existing domains") % poltype[self.type])
                 newte = re.sub("TEMPLATETYPE", self.name, user.te_existing_user_types)
                 newte += """gen_require(`"""
 
@@ -873,19 +865,21 @@ allow %s_t %s_t:%s_socket name_%s;
                 for t in self.types:
                     for i in self.DEFAULT_EXT:
                         if t.endswith(i):
+                            print t, t[:-len(i)]
                             newte += re.sub("TEMPLATETYPE", t[:-len(i)], self.DEFAULT_EXT[i].te_types)
                             break
-                return newte
 
-	def generate_new_rules(self):
-                newte = ""
-                for t in self.types:
+                if NEWTYPE and newte == "":
+                    default_ext = []
                     for i in self.DEFAULT_EXT:
-                        if t.endswith(i):
-                            newte += re.sub("TEMPLATETYPE", t[:-len(i)], self.DEFAULT_EXT[i].te_rules)
-                            break
+                        default_ext.append(i)
+                    raise ValueError(_("You need to define a new type which ends with: \n %s") % "\n ".join(default_ext)) 
+
                 return newte
 
+	def generate_new_rules(self):
+                return ""
+
 	def generate_daemon_types(self):
                 newte = re.sub("TEMPLATETYPE", self.name, executable.te_daemon_types)
                 if self.initscript != "":
@@ -1014,7 +1008,7 @@ allow %s_t %s_t:%s_socket name_%s;
 
 	def generate_roles_rules(self):
             newte = ""
-            if self.type in ( TUSER, XUSER, AUSER, LUSER, EUSER):
+            if self.type in ( TUSER, XUSER, AUSER, LUSER ):
                 roles = ""
                 if len(self.roles) > 0:
                     newte += re.sub("TEMPLATETYPE", self.name, user.te_sudo_rules)
@@ -1030,14 +1024,15 @@ allow %s_t %s_t:%s_socket name_%s;
 			if len(self.DEFAULT_DIRS[d][1]) > 0:
 				# CGI scripts already have a rw_t
 				if self.type != CGI or d != "rw":
-					newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_types)
+                                    newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_types)
 
                 if self.type != EUSER:
                     newte +="""
 ########################################
 #
 # %s local policy
-#""" % self.name
+#
+""" % self.name
                 newte += self.generate_capabilities()
                 newte += self.generate_process()
 		newte += self.generate_network_types()
@@ -1048,11 +1043,22 @@ allow %s_t %s_t:%s_socket name_%s;
 
                 for d in self.DEFAULT_KEYS:
 			if len(self.DEFAULT_DIRS[d][1]) > 0:
-				newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_rules)
-                                for i in self.DEFAULT_DIRS[d][1]:
-                                        if os.path.exists(i) and stat.S_ISSOCK(os.stat(i)[stat.ST_MODE]):
-                                            newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_stream_rules)
-                                            break
+                            if self.type == EUSER:
+                                newte_tmp = ""
+                                for domain in self.existing_domains:
+                                    newte_tmp += re.sub("TEMPLATETYPE_t", domain[:-2]+"_t", self.DEFAULT_DIRS[d][2].te_rules)
+                                    newte += re.sub("TEMPLATETYPE_rw_t", self.name+"_rw_t", newte_tmp)
+                            else:
+                                newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_rules)
+                            for i in self.DEFAULT_DIRS[d][1]:
+                                if os.path.exists(i) and stat.S_ISSOCK(os.stat(i)[stat.ST_MODE]):
+                                    if self.type == EUSER:
+                                        for domain in self.existing_domains:
+                                            newte += re.sub("TEMPLATETYPE", domain[:-2], self.DEFAULT_DIRS[d][2].te_stream_rules)
+                                        
+                                    else:
+                                        newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_stream_rules)
+                                    break
 
 		newte += self.generate_tmp_rules()
 		newte += self.generate_network_rules()
@@ -1077,19 +1083,6 @@ allow %s_t %s_t:%s_socket name_%s;
 	def generate_fc(self):
 		newfc = ""
                 fclist = []
-                if self.type in USERS +  [ SANDBOX ]:
-                    return executable.fc_user
-                if self.type != NEWTYPE and not self.program:
-                    raise ValueError(_("You must enter the executable path for your confined process"))
-
-                if self.program:
-                    t1 = re.sub("EXECUTABLE", self.program, executable.fc_program)
-                    fclist.append(re.sub("TEMPLATETYPE", self.name, t1))
-
-                if self.initscript != "":
-                    t1 = re.sub("EXECUTABLE", self.initscript, executable.fc_initscript)
-                    fclist.append(re.sub("TEMPLATETYPE", self.name, t1))
-
 		for i in self.files.keys():
                         if os.path.exists(i) and stat.S_ISSOCK(os.stat(i)[stat.ST_MODE]):
                             t1 = re.sub("TEMPLATETYPE", self.name, self.files[i][2].fc_sock_file)
@@ -1103,13 +1096,28 @@ allow %s_t %s_t:%s_socket name_%s;
 			t2 = re.sub("FILENAME", i, t1)
                         fclist.append(re.sub("FILETYPE", self.dirs[i][0], t2))
 
+                if self.type in USERS +  [ SANDBOX ]:
+                    if len(fclist) == 0:
+                        return executable.fc_user
+
+                if self.type not in USERS + [ SANDBOX, EUSER,  NEWTYPE ] and not self.program:
+                    raise ValueError(_("You must enter the executable path for your confined process"))
+
+                if self.program:
+                    t1 = re.sub("EXECUTABLE", self.program, executable.fc_program)
+                    fclist.append(re.sub("TEMPLATETYPE", self.name, t1))
+
+                if self.initscript != "":
+                    t1 = re.sub("EXECUTABLE", self.initscript, executable.fc_initscript)
+                    fclist.append(re.sub("TEMPLATETYPE", self.name, t1))
+
                 fclist.sort()
                 newfc="\n".join(fclist)
 		return newfc
 
 	def generate_user_sh(self):
             newsh = ""
-            if self.type not in ( TUSER, XUSER, AUSER, LUSER, EUSER):
+            if self.type not in ( TUSER, XUSER, AUSER, LUSER, RUSER):
                 return newsh
 
             roles = ""
@@ -1117,13 +1125,10 @@ allow %s_t %s_t:%s_socket name_%s;
                 roles += " %s_r" % role
             if roles != "":
                 roles += " system_r"
-            if self.type == EUSER:
-                tmp = re.sub("TEMPLATETYPE", self.name, script.eusers)
-            else:
-                tmp = re.sub("TEMPLATETYPE", self.name, script.users)
+            tmp = re.sub("TEMPLATETYPE", self.name, script.users)
             newsh += re.sub("ROLES", roles, tmp)
 
-            if self.type == RUSER:
+            if self.type == RUSER or self.type == AUSER:
                 for u in self.transition_users:
                     tmp =  re.sub("TEMPLATETYPE", self.name, script.admin_trans)
                     newsh += re.sub("USER", u, tmp)
@@ -1143,6 +1148,8 @@ allow %s_t %s_t:%s_socket name_%s;
                     newsh  = re.sub("TEMPLATEFILE", "%s" % self.file_name, temp)
                 else:
                     newsh  = re.sub("TEMPLATEFILE", self.file_name, temp)
+                    newsh += re.sub("DOMAINTYPE", self.name, script.manpage)
+                
                 if self.program:
                     newsh += re.sub("FILENAME", self.program, script.restorecon)
                 if self.initscript != "":
@@ -1165,6 +1172,7 @@ allow %s_t %s_t:%s_socket name_%s;
 			newsh += re.sub("TEMPLATETYPE", self.name, t1)
 
                 newsh += self.generate_user_sh()
+                newsh += re.sub("TEMPLATEFILE", self.file_name, script.rpm)
 
 		return newsh
 
@@ -1198,7 +1206,13 @@ allow %s_t %s_t:%s_socket name_%s;
 		if self.type not in APPLICATIONS:
                     newspec = re.sub("%relabel_files", "", newspec) 
                     
-		return newspec
+                # Remove man pages from EUSER spec file
+                if self.type == EUSER:
+                    newspec = re.sub(".*%s_selinux.8.*" % self.name,"", newspec)
+                # Remove user context file from non users spec file
+                if self.type not in ( TUSER, XUSER, AUSER, LUSER, RUSER):
+                    newspec = re.sub(".*%s_u.*" % self.name,"", newspec)
+                return newspec
 
 	def write_spec(self, out_dir):
 		specfile = "%s/%s_selinux.spec" % (out_dir, self.file_name)
@@ -1349,6 +1363,7 @@ Warning %s does not exist
             out += "%s # %s\n" % (self.write_te(out_dir), _("Type Enforcement file"))
             out += "%s # %s\n" % (self.write_if(out_dir), _("Interface file"))
             out += "%s # %s\n" % (self.write_fc(out_dir), _("File Contexts file"))
-            out += "%s # %s\n" % (self.write_spec(out_dir), _("Spec file"))
-            out += "%s # %s\n" % (self.write_sh(out_dir), _("Setup Script"))
+            if self.type != NEWTYPE:
+                out += "%s # %s\n" % (self.write_spec(out_dir), _("Spec file"))
+                out += "%s # %s\n" % (self.write_sh(out_dir), _("Setup Script"))
             return out
diff --git a/policycoreutils/sepolicy/sepolicy/gui.py b/policycoreutils/sepolicy/sepolicy/gui.py
new file mode 100644
index 0000000..1588d77
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/gui.py
@@ -0,0 +1,2833 @@
+#!/usr/bin/python -Es
+#
+# Copyright (C) 2013 Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# selinux gui is a tool for the examining and modifying SELinux policy
+#
+#    This program is free software; you can redistribute it and/or
+#    modify it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation; either version 2 of
+#    the License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program; if not, write to the Free Software
+#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+#                                        02111-1307  USA
+#
+#    author: Ryan Hallisey rhallisey@redhat.com
+#    author: Dan Walsh dwalsh@redhat.com
+#    author: Miroslav Grepl mgrepl@redhat.com
+#
+#
+
+from gi.repository import Gtk
+from gi.repository import Gdk
+from gi.repository import GLib
+from sepolicy.sedbus import SELinuxDBus
+import sys
+import sepolicy
+import selinux
+from selinux import DISABLED, PERMISSIVE, ENFORCING
+import sepolicy.network
+import sepolicy.manpage
+import dbus
+import time
+import os, re
+import gettext
+import unicodedata
+
+PROGNAME="policycoreutils"
+gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
+gettext.textdomain(PROGNAME)
+try:
+    gettext.install(PROGNAME,
+                    localedir="/usr/share/locale",
+                    unicode=False,
+                    codeset = 'utf-8')
+except IOError:
+    import __builtin__
+    __builtin__.__dict__['_'] = unicode
+
+reverse_file_type_str = {}
+for f in sepolicy.file_type_str:
+    reverse_file_type_str[sepolicy.file_type_str[f]] = f
+
+enabled=[_("No"), _("Yes")]
+action=[_("Disable"), _("Enable")]
+def compare(a, b):
+    return cmp(a.lower(),b.lower())
+
+import distutils.sysconfig
+ADVANCED_LABEL = ( _("Advanced >>"), _("Advanced <<") )
+ADVANCED_SEARCH_LABEL = ( _("Advanced Search >>"), _("Advanced Search <<") )
+OUTBOUND_PAGE = 0
+INBOUND_PAGE = 1
+
+TRANSITIONS_FROM_PAGE=0
+TRANSITIONS_TO_PAGE=1
+TRANSITIONS_FILE_PAGE=2
+
+EXE_PAGE = 0
+WRITABLE_PAGE = 1
+APP_PAGE = 2
+
+BOOLEANS_PAGE=0
+FILES_PAGE=1
+NETWORK_PAGE=2
+TRANSITIONS_PAGE=3
+LOGIN_PAGE=4
+USER_PAGE=5
+LOCKDOWN_PAGE=6
+SYSTEM_PAGE=7
+FILE_EQUIV_PAGE=8
+START_PAGE=9
+
+keys = ["boolean", "fcontext", "fcontext-equiv", "port", "login", "user", "module", "node", "interface" ]
+
+DISABLED_TEXT = _("""<small>
+To change from Disabled to Enforcing mode
+- Change the system mode from Disabled to Permissive
+- Reboot, so that the system can relabel
+- Once the system is working as planned
+  * Change the system mode to Enforcing</small>
+""")
+
+class SELinuxGui():
+
+    def __init__( self , app = None, test = False):
+        self.finish_init = False
+        self.opage = START_PAGE
+        self.dbus = SELinuxDBus()
+        try:
+            customized = self.dbus.customized()
+        except dbus.exceptions.DBusException, e:
+            print e
+            self.quit()
+
+        sepolicy_domains = sepolicy.get_all_domains()
+        sepolicy_domains.sort(compare)
+        if app and app not in sepolicy_domains:
+            self.error(_("%s is not a valid domain" % app))
+            self.quit()
+
+        self.init_cur()
+        self.application = app
+        self.filter_txt = ""
+        builder = Gtk.Builder() # BUILDER OBJ
+        self.code_path = distutils.sysconfig.get_python_lib(plat_specific = True) + "/sepolicy/"
+        glade_file = self.code_path + "sepolicy.glade"
+        builder.add_from_file(glade_file)
+        self.outer_notebook = builder.get_object("outer_notebook")
+        self.window = builder.get_object("SELinux_window")
+        self.main_selection_window = builder.get_object("Main_selection_menu")
+        self.main_advanced_label = builder.get_object("main_advanced_label")
+        self.popup = 0
+        self.applications_selection_button = builder.get_object("applications_selection_button")
+        self.revert_button = builder.get_object("Revert_button")
+        self.busy_cursor = Gdk.Cursor(Gdk.CursorType.WATCH)
+        self.ready_cursor = Gdk.Cursor(Gdk.CursorType.LEFT_PTR)
+        self.initialtype = selinux.selinux_getpolicytype()[1]
+        self.current_popup = None
+        self.import_export = None
+        self.clear_entry = True
+        self.files_add = False
+        self.network_add = False
+
+        self.all_list = []
+        self.installed_list = []
+        self.previously_modified = {}
+
+        # file dialog
+        self.file_dialog = builder.get_object("add_path_dialog")
+        # Error check ***************************************
+        self.error_check_window = builder.get_object("error_check_window")
+        self.error_check_label = builder.get_object("error_check_label")
+        self.invalid_entry = False
+        # Advanced search window ****************************
+        self.advanced_search_window = builder.get_object("advanced_search_window")
+        self.advanced_search_liststore = builder.get_object("Advanced_search_liststore")
+        self.advanced_search_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.advanced_search_filter = builder.get_object("advanced_filter")
+        self.advanced_search_filter.set_visible_func(self.filter_the_data)
+        self.advanced_filter_entry = builder.get_object("advanced_filter_entry")
+        self.advanced_search_treeview = builder.get_object("advanced_search_treeview")
+        self.advanced_search = False
+
+        # Login Items **************************************
+        self.login_label = builder.get_object("Login_label")
+        self.login_seuser_combobox = builder.get_object("login_seuser_combobox")
+        self.login_seuser_combolist = builder.get_object("login_seuser_liststore")
+        self.login_name_entry = builder.get_object("login_name_entry")
+        self.login_mls_label = builder.get_object("login_mls_label")
+        self.login_mls_entry = builder.get_object("login_mls_entry")
+        self.login_radio_button = builder.get_object("Login_button")
+        self.login_treeview = builder.get_object("login_treeview")
+        self.login_liststore = builder.get_object("login_liststore")
+        self.login_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.login_filter = builder.get_object("login_filter")
+        self.login_filter.set_visible_func(self.filter_the_data)
+        self.login_popup_window = builder.get_object("login_popup_window")
+        self.login_delete_liststore = builder.get_object("login_delete_liststore")
+        self.login_delete_window = builder.get_object("login_delete_window")
+
+        # Users Items **************************************
+        self.user_popup_window = builder.get_object("user_popup_window")
+        self.user_radio_button = builder.get_object("User_button")
+        self.user_liststore = builder.get_object("user_liststore")
+        self.user_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.user_filter = builder.get_object("user_filter")
+        self.user_filter.set_visible_func(self.filter_the_data)
+        self.user_treeview = builder.get_object("user_treeview")
+        self.user_roles_combobox = builder.get_object("user_roles_combobox")
+        self.user_roles_combolist = builder.get_object("user_roles_liststore")
+        self.user_label = builder.get_object("User_label")
+        self.user_name_entry = builder.get_object("user_name_entry")
+        self.user_mls_label = builder.get_object("user_mls_label")
+        self.user_mls_level_entry = builder.get_object("user_mls_level_entry")
+        self.user_mls_entry = builder.get_object("user_mls_entry")
+        self.user_combobox = builder.get_object("selinux_user_combobox")
+        self.user_delete_liststore = builder.get_object("user_delete_liststore")
+        self.user_delete_window = builder.get_object("user_delete_window")
+
+        # File Equiv Items **************************************
+        self.file_equiv_label = builder.get_object("file_equiv_label")
+        self.file_equiv_source_entry = builder.get_object("file_equiv_source_entry")
+        self.file_equiv_dest_entry = builder.get_object("file_equiv_dest_entry")
+        self.file_equiv_radio_button = builder.get_object("file_equiv_button")
+        self.file_equiv_treeview = builder.get_object("file_equiv_treeview")
+        self.file_equiv_liststore = builder.get_object("file_equiv_liststore")
+        self.file_equiv_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.file_equiv_popup_window = builder.get_object("file_equiv_popup_window")
+        self.file_equiv_treefilter = builder.get_object("file_equiv_filter")
+        self.file_equiv_treefilter.set_visible_func(self.filter_the_data)
+        self.file_equiv_delete_liststore = builder.get_object("file_equiv_delete_liststore")
+        self.file_equiv_delete_window = builder.get_object("file_equiv_delete_window")
+
+        # System Items **************************************
+        self.app_system_button = builder.get_object("app_system_button")
+        self.system_radio_button = builder.get_object("System_button")
+        self.lockdown_radio_button = builder.get_object("Lockdown_button")
+        self.systems_box = builder.get_object("Systems_box")
+        self.relabel_button = builder.get_object("Relabel_button")
+        self.relabel_button_no = builder.get_object("Relabel_button_no")
+        self.advanced_system = builder.get_object("advanced_system")
+        self.outer_notebook_frame = builder.get_object("outer_notebook_frame")
+        self.system_policy_label = builder.get_object("system_policy_type_label")
+        # Browse Items **************************************
+        self.select_button_browse = builder.get_object("select_button_browse")
+        self.cancel_button_browse = builder.get_object("cancel_button_browse")
+        # More types window items ***************************
+        self.moreTypes_window_files = builder.get_object("moreTypes_window_files")
+        self.more_types_files_liststore = builder.get_object("more_types_file_liststore")
+        self.moreTypes_treeview = builder.get_object("moreTypes_treeview_files")
+        # System policy type ********************************
+        self.system_policy_type_liststore = builder.get_object("system_policy_type_liststore")
+        self.system_policy_type_combobox = builder.get_object("system_policy_type_combobox")
+        self.policy_list = []
+        if self.populate_system_policy() < 2:
+            self.advanced_system.set_visible(False)
+            self.system_policy_label.set_visible(False)
+            self.system_policy_type_combobox.set_visible(False)
+            
+        self.enforcing_button_default = builder.get_object("Enforcing_button_default")
+        self.permissive_button_default = builder.get_object("Permissive_button_default")
+        self.disabled_button_default = builder.get_object("Disabled_button_default")
+        self.initialize_system_default_mode()
+
+        # Lockdown Window *********************************
+        self.enable_unconfined_button = builder.get_object("enable_unconfined")
+        self.disable_unconfined_button = builder.get_object("disable_unconfined")
+        self.enable_permissive_button = builder.get_object("enable_permissive")
+        self.disable_permissive_button = builder.get_object("disable_permissive")
+        self.enable_ptrace_button = builder.get_object("enable_ptrace")
+        self.disable_ptrace_button = builder.get_object("disable_ptrace")
+
+        # Help Window *********************************
+        self.help_window = builder.get_object("help_window")
+        self.help_text = builder.get_object("help_textv")
+        self.info_text = builder.get_object("info_text")
+        self.help_image = builder.get_object("help_image")
+        self.forward_button = builder.get_object("forward_button")
+        self.back_button = builder.get_object("back_button")
+        # Update menu items *********************************
+        self.update_window = builder.get_object("update_window")
+        self.update_treeview = builder.get_object("update_treeview")
+        self.update_treestore = builder.get_object("Update_treestore")
+        self.apply_button = builder.get_object("apply_button")
+        self.update_button = builder.get_object("Update_button")
+        # Add button objects ********************************
+        self.add_button = builder.get_object("Add_button")
+        self.delete_button = builder.get_object("Delete_button")
+
+        self.files_path_entry = builder.get_object("files_path_entry")
+        self.network_ports_entry = builder.get_object("network_ports_entry")
+        self.files_popup_window = builder.get_object("files_popup_window")
+        self.network_popup_window = builder.get_object("network_popup_window")
+
+        self.popup_network_label = builder.get_object("Network_label")
+        self.popup_files_label = builder.get_object("files_label")
+
+        self.recursive_path_toggle = builder.get_object("make_path_recursive")
+        self.files_type_combolist = builder.get_object("files_type_combo_store")
+        self.files_class_combolist = builder.get_object("files_class_combo_store")
+        self.files_type_combobox = builder.get_object("files_type_combobox")
+        self.files_class_combobox = builder.get_object("files_class_combobox")
+        self.files_mls_label = builder.get_object("files_mls_label")
+        self.files_mls_entry = builder.get_object("files_mls_entry")
+        self.advanced_text_files = builder.get_object("Advanced_text_files")
+        self.files_cancel_button = builder.get_object("cancel_delete_files")
+
+        self.network_tcp_button = builder.get_object("tcp_button")
+        self.network_udp_button = builder.get_object("udp_button")
+        self.network_port_type_combolist = builder.get_object("network_type_combo_store")
+        self.network_port_type_combobox = builder.get_object("network_type_combobox")
+        self.network_mls_label = builder.get_object("network_mls_label")
+        self.network_mls_entry = builder.get_object("network_mls_entry")
+        self.advanced_text_network = builder.get_object("Advanced_text_network")
+        self.network_cancel_button = builder.get_object("cancel_network_delete")
+
+        # Add button objects ********************************
+
+        # Modify items **************************************
+        self.show_mislabeled_files_only = builder.get_object("Show_mislabeled_files")
+        self.mislabeled_files_label = builder.get_object("mislabeled_files_label")
+        self.warning_files = builder.get_object("warning_files")
+        self.modify_button = builder.get_object("Modify_button")
+        self.modify_button.set_sensitive(False)
+        # Modify items **************************************
+
+        # Fix label *****************************************
+        self.fix_label_window = builder.get_object("fix_label_window")
+        self.fixlabel_label = builder.get_object("fixlabel_label")
+        self.fix_label_cancel = builder.get_object("fix_label_cancel")
+        # Fix label *****************************************
+
+        # Delete items **************************************
+        self.files_delete_window = builder.get_object("files_delete_window")
+        self.files_delete_treeview = builder.get_object("files_delete_treeview")
+        self.files_delete_liststore = builder.get_object("files_delete_liststore")
+        self.network_delete_window = builder.get_object("network_delete_window")
+        self.network_delete_treeview = builder.get_object("network_delete_treeview")
+        self.network_delete_liststore =builder.get_object("network_delete_liststore")
+        # Delete items **************************************
+
+        # Progress bar **************************************
+        self.progress_bar = builder.get_object("progress_bar")
+        # Progress bar **************************************
+
+        # executable_files items ****************************
+        self.executable_files_treeview = builder.get_object("Executable_files_treeview")                  # Get the executable files tree view
+        self.executable_files_filter= builder.get_object("executable_files_filter")
+        self.executable_files_filter.set_visible_func(self.filter_the_data)
+        self.executable_files_tab = builder.get_object("Executable_files_tab")
+        self.executable_files_tab_tooltip_txt = self.executable_files_tab.get_tooltip_text()
+        self.executable_files_liststore = builder.get_object("executable_files_treestore")
+        self.executable_files_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+
+        self.files_radio_button = builder.get_object("files_button")
+        self.files_button_tooltip_txt = self.files_radio_button.get_tooltip_text()
+        # executable_files items ****************************
+
+        # writable files items ******************************
+        self.writable_files_treeview = builder.get_object("Writable_files_treeview")           # Get the Writable files tree view
+        self.writable_files_liststore = builder.get_object("writable_files_treestore")         # Contains the tree with File Path, SELinux File Label, Class
+        self.writable_files_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.writable_files_filter = builder.get_object("writable_files_filter")
+        self.writable_files_filter.set_visible_func(self.filter_the_data)
+        self.writable_files_tab = builder.get_object("Writable_files_tab")
+        self.writable_files_tab_tooltip_txt = self.writable_files_tab.get_tooltip_text()
+        # writable files items ******************************
+
+        # Application File Types ****************************
+        self.application_files_treeview = builder.get_object("Application_files_treeview")                    # Get the Application files tree view
+        self.application_files_filter = builder.get_object("application_files_filter")         # Contains the tree with File Path, Description, Class
+        self.application_files_filter.set_visible_func(self.filter_the_data)
+        self.application_files_tab = builder.get_object("Application_files_tab")
+        self.application_files_tab_tooltip_txt = self.writable_files_tab.get_tooltip_text()
+        self.application_files_liststore = builder.get_object("application_files_treestore")
+        self.application_files_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.application_files_tab = builder.get_object("Application_files_tab")
+        self.application_files_tab_tooltip_txt = self.application_files_tab.get_tooltip_text()
+        # Application File Type *****************************
+
+        # network items *************************************
+        self.network_radio_button = builder.get_object("network_button")
+        self.network_button_tooltip_txt = self.network_radio_button.get_tooltip_text()
+
+        self.network_out_treeview = builder.get_object("outbound_treeview")
+        self.network_out_liststore = builder.get_object("network_out_liststore")
+        self.network_out_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.network_out_filter =  builder.get_object("network_out_filter")
+        self.network_out_filter.set_visible_func(self.filter_the_data)
+        self.network_out_tab = builder.get_object("network_out_tab")
+        self.network_out_tab_tooltip_txt = self.network_out_tab.get_tooltip_text()
+
+        self.network_in_treeview = builder.get_object("inbound_treeview")
+        self.network_in_liststore = builder.get_object("network_in_liststore")
+        self.network_in_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.network_in_filter =  builder.get_object("network_in_filter")
+        self.network_in_filter.set_visible_func(self.filter_the_data)
+        self.network_in_tab = builder.get_object("network_in_tab")
+        self.network_in_tab_tooltip_txt = self.network_in_tab.get_tooltip_text()
+        # network items *************************************
+
+        # boolean items ************************************
+        self.boolean_treeview = builder.get_object("Boolean_treeview")         # Get the booleans tree list
+        self.boolean_liststore = builder.get_object("boolean_liststore")
+        self.boolean_liststore.set_sort_column_id(2, Gtk.SortType.ASCENDING)
+        self.boolean_filter = builder.get_object("boolean_filter")
+        self.boolean_filter.set_visible_func(self.filter_the_data)
+
+        self.boolean_more_detail_window = builder.get_object("booleans_more_detail_window")
+        self.boolean_more_detail_treeview = builder.get_object("booleans_more_detail_treeview")
+        self.boolean_more_detail_tree_data_set = builder.get_object("booleans_more_detail_liststore")
+        self.boolean_radio_button = builder.get_object("Booleans_button")
+        self.active_button = self.boolean_radio_button
+        self.boolean_button_tooltip_txt = self.boolean_radio_button.get_tooltip_text()
+        # boolean items ************************************
+
+        # transitions items ************************************
+        self.transitions_into_treeview = builder.get_object("transitions_into_treeview")         # Get the transitions tree list Enabled, source, Executable File
+        self.transitions_into_liststore = builder.get_object("transitions_into_liststore")   # Contains the tree with
+        self.transitions_into_liststore.set_sort_column_id(1, Gtk.SortType.ASCENDING)
+        self.transitions_into_filter = builder.get_object("transitions_into_filter")
+        self.transitions_into_filter.set_visible_func(self.filter_the_data)
+        self.transitions_into_tab = builder.get_object("Transitions_into_tab")
+        self.transitions_into_tab_tooltip_txt = self.transitions_into_tab.get_tooltip_text()
+
+        self.transitions_radio_button = builder.get_object("Transitions_button")
+        self.transitions_button_tooltip_txt = self.transitions_radio_button.get_tooltip_text()
+
+        self.transitions_from_treeview = builder.get_object("transitions_from_treeview")         # Get the transitions tree list
+        self.transitions_from_treestore = builder.get_object("transitions_from_treestore")       # Contains the tree with Enabled, Executable File Type, Transtype
+        self.transitions_from_treestore.set_sort_column_id(2, Gtk.SortType.ASCENDING)
+        self.transitions_from_filter = builder.get_object("transitions_from_filter")
+        self.transitions_from_filter.set_visible_func(self.filter_the_data)
+        self.transitions_from_tab = builder.get_object("Transitions_from_tab")
+        self.transitions_from_tab_tooltip_txt = self.transitions_from_tab.get_tooltip_text()
+
+        self.transitions_file_treeview = builder.get_object("file_transitions_treeview")         # Get the transitions tree list
+        self.transitions_file_liststore = builder.get_object("file_transitions_liststore")       # Contains the tree with Enabled, Executable File Type, Transtype
+        self.transitions_file_liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
+        self.transitions_file_filter = builder.get_object("file_transitions_filter")
+        self.transitions_file_filter.set_visible_func(self.filter_the_data)
+        self.transitions_file_tab = builder.get_object("file_transitions")
+        self.transitions_file_tab_tooltip_txt = self.transitions_from_tab.get_tooltip_text()
+        # transitions items ************************************
+
+        # Combobox and Entry items **************************
+        self.combobox_menu = builder.get_object("combobox_org")                    # This is the combobox box object, aka the arrow next to the entry text bar
+        self.combobox_menu_model = builder.get_object("application_liststore")
+        self.completion_entry = builder.get_object("completion_entry")        #self.combobox_menu.get_child()
+        self.completion_entry_model = builder.get_object("application_liststore")
+        self.entrycompletion_obj = builder.get_object("entrycompletion_obj")
+        #self.entrycompletion_obj = Gtk.EntryCompletion()
+        self.entrycompletion_obj.set_model(self.completion_entry_model)
+        self.entrycompletion_obj.set_minimum_key_length(0)
+        self.entrycompletion_obj.set_text_column(0)
+        self.entrycompletion_obj.set_match_func(self.match_func, None)
+        self.completion_entry.set_completion(self.entrycompletion_obj)
+        self.completion_entry.set_icon_from_stock(0, Gtk.STOCK_FIND)
+        # Combobox and Entry items **************************
+
+        # Modify buttons ************************************
+        self.show_modified_only = builder.get_object("Show_modified_only_toggle")
+        # Modify button *************************************
+
+        # status bar *****************************************
+        self.current_status_label = builder.get_object("Enforcing_label")
+        self.current_status_enforcing = builder.get_object("Enforcing_button")
+        self.current_status_permissive = builder.get_object("Permissive_button")
+        self.status_bar = builder.get_object("status_bar")
+        self.context_id = self.status_bar.get_context_id("SELinux status")
+
+        # filters *********************************************
+        self.filter_entry = builder.get_object("filter_entry")
+        self.filter_box = builder.get_object("filter_box")
+        self.add_modify_delete_box = builder.get_object("add_modify_delete_box")
+        # Get_model() sets the tree model filter to be the parent of the tree model (tree model has all the data in it)
+
+        # Toggle button ****************************************
+        self.cell = builder.get_object("activate")
+        self.del_cell_files = builder.get_object("files_toggle_delete")
+        self.del_cell_files.connect("toggled", self.on_toggle_update, self.files_delete_liststore)
+        self.del_cell_files_equiv = builder.get_object("file_equiv_toggle_delete1")
+        self.del_cell_files_equiv.connect("toggled", self.on_toggle_update, self.file_equiv_delete_liststore)
+        self.del_cell_user = builder.get_object("user_toggle_delete")
+        self.del_cell_user.connect("toggled", self.on_toggle_update, self.user_delete_liststore)
+        self.del_cell_login = builder.get_object("login_toggle_delete")
+        self.del_cell_login.connect("toggled", self.on_toggle_update, self.login_delete_liststore)
+        self.del_cell_network = builder.get_object("network_toggle_delete")
+        self.del_cell_network.connect("toggled", self.on_toggle_update, self.network_delete_liststore)
+        self.update_cell = builder.get_object("toggle_update")
+        # Notebook items ***************************************
+        self.outer_notebook = builder.get_object("outer_notebook")
+        self.inner_notebook_files = builder.get_object("files_inner_notebook")
+        self.inner_notebook_network = builder.get_object("network_inner_notebook")
+        self.inner_notebook_transitions = builder.get_object("transitions_inner_notebook")
+        # logind gui ***************************************
+        loading_gui = builder.get_object("loading_gui")
+
+        self.update_cell.connect("toggled", self.on_toggle_update, self.update_treestore)
+        self.all_entries = []
+
+        # Need to connect button on code because the tree view model is a treeviewsort
+        self.cell.connect("toggled", self.on_toggle, self.boolean_liststore)
+
+        self.loading = 1
+        path = None
+        if test:
+            domains = [ "httpd_t", "abrt_t" ]
+        else:
+            domains = sepolicy_domains
+            loading_gui.show()
+        length = len(domains)
+        for domain in domains:
+            # After the user selects a path in the drop down menu call
+            # get_init_entrypoint_target(entrypoint) to get the transtype
+            # which will give you the application
+            self.combo_box_initialize(domain, None)
+            self.advanced_search_initialize(domain)
+            self.all_list.append(domain)
+            self.percentage = float(float(self.loading)/float(length))
+            self.progress_bar.set_fraction(self.percentage)
+            self.progress_bar.set_pulse_step(self.percentage)
+            self.idle_func()
+
+            entrypoint = sepolicy.get_init_entrypoint(domain)
+            if entrypoint:
+                path = sepolicy.find_entrypoint_path(entrypoint)
+                if path:
+                    self.combo_box_initialize(path, None)
+                    # Adds all files entrypoint paths that exists on disc
+                    # into the combobox
+                    self.advanced_search_initialize(path)
+                    self.installed_list.append(path)
+
+            self.loading += 1
+        loading_gui.hide()
+
+        dic = {
+               "on_combo_button_clicked" : self.open_combo_menu,
+               "on_disable_ptrace_toggled" : self.on_disable_ptrace,
+               "on_SELinux_window_configure_event" : self.hide_combo_menu,
+               "on_entrycompletion_obj_match_selected" : self.set_application_label,
+               "on_filter_changed" : self.get_filter_data,
+               "on_save_changes_file_equiv_clicked" : self.update_to_file_equiv,
+               "on_save_changes_login_clicked" : self.update_to_login,
+               "on_save_changes_user_clicked" : self.update_to_user,
+               "on_save_changes_files_clicked" : self.update_to_files,
+               "on_save_changes_network_clicked" : self.update_to_network,
+               "on_Advanced_text_files_button_press_event" : self.reveal_advanced,
+               "item_in_tree_selected" : self.cursor_changed,
+               "on_Application_file_types_treeview_configure_event" : self.resize_wrap,
+               "on_save_delete_clicked" : self.on_save_delete_clicked,
+               "on_moreTypes_treeview_files_row_activated" : self.populate_type_combo,
+               "on_retry_button_files_clicked" : self.invalid_entry_retry,
+               "on_make_path_recursive_toggled" : self.recursive_path,
+               "on_files_path_entry_button_press_event" : self.highlight_entry_text,
+               "on_files_path_entry_changed" : self.autofill_add_files_entry,
+               "on_select_type_files_clicked" : self.select_type_more,
+               "on_choose_file" : self.on_browse_select,
+               "on_Enforcing_button_toggled" : self.set_enforce,
+               "on_confirmation_close" : self.confirmation_close,
+               "on_column_clicked" : self.column_clicked,
+               "on_tab_switch" : self.clear_filters,
+
+               "on_file_equiv_button_clicked" : self.show_file_equiv_page,
+               "on_app/system_button_clicked" : self.system_interface,
+               "on_app/users_button_clicked" : self.users_interface,
+               "on_main_advanced_label_button_press_event": self.advanced_label_main,
+
+               "on_Show_mislabeled_files_toggled" : self.show_mislabeled_files,
+               "on_Browse_button_files_clicked" : self.browse_for_files,
+               "on_cancel_popup_clicked" : self.close_popup,
+               "on_treeview_cursor_changed" : self.cursor_changed,
+               "on_login_seuser_combobox_changed"  : self.login_seuser_combobox_change,
+               "on_user_roles_combobox_changed":self.user_roles_combobox_change,
+
+               "on_cancel_button_browse_clicked" : self.close_config_window,
+               "on_apply_button_clicked" : self.apply_changes_button_press,
+               "on_Revert_button_clicked" : self.update_or_revert_changes,
+               "on_Update_button_clicked" : self.update_or_revert_changes,
+               "on_advanced_filter_entry_changed" : self.get_advanced_filter_data,
+               "on_advanced_search_treeview_row_activated" : self.advanced_item_selected,
+               "on_Select_advanced_search_clicked" : self.advanced_item_button_push,
+               "on_All_advanced_button_toggled" : self.advanced_radio_select,
+               "on_Installed_advanced_button_toggled" : self.advanced_radio_select,
+               "on_info_button_button_press_event" : self.on_help_button,
+               "on_back_button_clicked" : self.on_help_back_clicked,
+               "on_forward_button_clicked" : self.on_help_forward_clicked,
+               "on_Boolean_treeview_columns_changed" : self.resize_columns,
+               "on_completion_entry_changed" : self.application_selected,
+               "on_Add_button_clicked" : self.add_button_clicked,
+               "on_Delete_button_clicked" : self.delete_button_clicked,
+               "on_Modify_button_clicked" : self.modify_button_clicked,
+               "on_Show_modified_only_toggled" : self.on_show_modified_only,
+               "on_cancel_button_config_clicked" : self.close_config_window,
+               "on_Import_button_clicked" : self.import_config_show,
+               "on_Export_button_clicked" : self.export_config_show,
+               "on_enable_unconfined_toggled": self.unconfined_toggle,
+               "on_enable_permissive_toggled": self.permissive_toggle,
+               "on_system_policy_type_combobox_changed" : self.change_default_policy,
+               "on_Enforcing_button_default_toggled" : self.change_default_mode,
+               "on_Permissive_button_default_toggled" : self.change_default_mode,
+               "on_Disabled_button_default_toggled" : self.change_default_mode,
+
+               "on_Relabel_button_toggled_cb": self.relabel_on_reboot,
+               "on_advanced_system_button_press_event" : self.reveal_advanced_system,
+               "on_files_type_combobox_changed" : self.show_more_types,
+               "on_filter_row_changed" : self.filter_the_data,
+               "on_button_toggled" : self.tab_change,
+               "gtk_main_quit": self.closewindow
+               }
+
+        self.previously_modified_initialize(customized)
+        builder.connect_signals(dic)
+        self.window.show()                # Show the gui to the screen
+        GLib.timeout_add_seconds(5,self.selinux_status)
+        self.selinux_status()
+        self.lockdown_inited = False
+        self.add_modify_delete_box.hide()
+        self.filter_box.hide()
+        if self.status == DISABLED:
+            self.show_system_page()
+        else:
+            if self.application:
+                self.applications_selection_button.set_label(self.application)
+                self.completion_entry.set_text(self.application)
+                self.show_applications_page()
+                self.tab_change()
+            else:
+                self.clearbuttons()
+                self.outer_notebook.set_current_page(START_PAGE)
+
+        self.reinit()
+        self.finish_init = True
+        Gtk.main()
+
+    def init_cur(self):
+        self.cur_dict = {}
+        for k in keys:
+            self.cur_dict[k] = {}
+
+    def remove_cur(self,ctr):
+        i = 0
+        for k in self.cur_dict:
+            for j in self.cur_dict[k]:
+                if i == ctr:
+                    del(self.cur_dict[k][j])
+                    return
+                i += 1
+
+    def selinux_status(self):
+        try:
+            self.status = selinux.security_getenforce()
+        except OSError:
+            self.status = DISABLED
+        if self.status == DISABLED:
+            self.current_status_label.set_sensitive(False)
+            self.current_status_enforcing.set_sensitive(False)
+            self.current_status_permissive.set_sensitive(False)
+            self.enforcing_button_default.set_sensitive(False)
+            self.status_bar.push(self.context_id,  _("System Status: Disabled"))
+            self.info_text.set_label(DISABLED_TEXT)
+        else:
+            self.set_enforce_text(self.status)
+        if os.path.exists('/.autorelabel'):
+            self.relabel_button.set_active(True)
+        else:
+            self.relabel_button_no.set_active(True)
+
+        policytype = selinux.selinux_getpolicytype()[1]
+
+        mode = selinux.selinux_getenforcemode()[1]
+        if mode == ENFORCING:
+            self.enforcing_button_default.set_active(True)
+        if mode == PERMISSIVE:
+            self.permissive_button_default.set_active(True)
+        if mode == DISABLED:
+            self.disabled_button_default.set_active(True)
+
+        return True
+
+    def lockdown_init(self):
+        if self.lockdown_inited:
+            return
+        self.wait_mouse()
+        self.lockdown_inited = True
+        self.disable_ptrace_button.set_active(selinux.security_get_boolean_active("deny_ptrace"))
+        self.module_dict = {}
+        for m in self.dbus.semodule_list().split("\n"):
+            mod = m.split()
+            if len(mod) < 2:
+                continue
+            self.module_dict[mod[0]] = { "version": mod[1], "Disabled" : (len(mod) > 2) }
+
+        self.enable_unconfined_button.set_active(not self.module_dict["unconfined"]["Disabled"])
+        self.enable_permissive_button.set_active(not self.module_dict["permissivedomains"]["Disabled"])
+        self.ready_mouse()
+
+    def column_clicked(self, treeview, treepath, treecol, *args):
+        iter = self.get_selected_iter()
+        if not iter:
+            return
+
+        if self.opage == BOOLEANS_PAGE:
+            if treecol.get_name() == "more_detail_col":
+                self.display_more_detail(self.window, treepath)
+
+        if self.opage == FILES_PAGE:
+            visible = self.liststore.get_value(iter, 3)
+            # If visible is true then fix mislabeled will be visible
+            if treecol.get_name() == "restorecon_col" and visible:
+                self.fix_mislabeled(self.liststore.get_value(iter, 0))
+
+        if self.opage == TRANSITIONS_PAGE:
+            bool_name = self.liststore.get_value(iter, 1)
+            if bool_name:
+                self.boolean_radio_button.clicked()
+                self.filter_entry.set_text(bool_name)
+
+    def idle_func(self):
+        while Gtk.events_pending():
+            Gtk.main_iteration()
+
+    def match_func(self, completion, key_string, iter, func_data):
+        try:
+            if self.combobox_menu_model.get_value(iter, 0).find(key_string) != -1:
+                return True
+            return False
+        except AttributeError:
+            pass
+
+    def help_show_page(self):
+        self.back_button.set_sensitive(self.help_page != 0)
+        self.forward_button.set_sensitive(self.help_page < (len(self.help_list) - 1))
+        try:
+            fd = open("%shelp/%s.txt" % (self.code_path, self.help_list[self.help_page]), "r")
+            buf = fd.read()
+            fd.close()
+        except IOError:
+            buf = ""
+        help_text = self.help_text.get_buffer()
+        help_text.set_text(buf % { "APP": self.application })
+        self.help_text.set_buffer(help_text)
+        self.help_image.set_from_file("%shelp/%s.png" % (self.code_path, self.help_list[self.help_page]))
+        self.show_popup(self.help_window)
+
+    def on_help_back_clicked(self, *args):
+        self.help_page -= 1
+        self.help_show_page()
+
+    def on_help_forward_clicked(self, *args):
+        self.help_page += 1
+        self.help_show_page()
+
+    def on_help_button(self, *args):
+        self.help_page = 0
+        self.help_list = []
+        if self.opage == START_PAGE:
+            self.help_window.set_title(_("Help: Start Page"))
+            self.help_list = [ "start"]
+
+        if self.opage == BOOLEANS_PAGE:
+            self.help_window.set_title(_("Help: Booleans Page"))
+            self.help_list = [ "booleans", "booleans_toggled", "booleans_more", "booleans_more_show"]
+
+        if self.opage == FILES_PAGE:
+            ipage = self.inner_notebook_files.get_current_page()
+            if ipage == EXE_PAGE:
+                self.help_window.set_title(_("Help: Executable Files Page"))
+                self.help_list = [ "files_exec" ]
+            if ipage == WRITABLE_PAGE:
+                self.help_window.set_title(_("Help: Writable Files Page"))
+                self.help_list = [ "files_write" ]
+            if ipage == APP_PAGE:
+                self.help_window.set_title(_("Help: Application Types Page"))
+                self.help_list = [ "files_app" ]
+        if self.opage == NETWORK_PAGE:
+            ipage = self.inner_notebook_network.get_current_page()
+            if ipage == OUTBOUND_PAGE:
+                self.help_window.set_title(_("Help: Outbound Network Connections Page"))
+                self.help_list = [ "ports_outbound" ]
+            if ipage == INBOUND_PAGE:
+                self.help_window.set_title(_("Help: Inbound Network Connections Page"))
+                self.help_list = [ "ports_inbound" ]
+
+        if self.opage == TRANSITIONS_PAGE:
+            ipage = self.inner_notebook_transitions.get_current_page()
+            if ipage == TRANSITIONS_FROM_PAGE:
+                self.help_window.set_title(_("Help: Transition from application Page"))
+                self.help_list = [ "transition_from", "transition_from_boolean", "transition_from_boolean_1", "transition_from_boolean_2"]
+            if ipage == TRANSITIONS_TO_PAGE:
+                self.help_window.set_title(_("Help: Transition into application Page"))
+                self.help_list = [ "transition_to" ]
+            if ipage == TRANSITIONS_FILE_PAGE:
+                self.help_window.set_title(_("Help: Transition application file Page"))
+                self.help_list = [ "transition_file" ]
+
+        if self.opage == SYSTEM_PAGE:
+                self.help_window.set_title(_("Help: Systems Page"))
+                self.help_list = [ "system", "system_boot_mode", "system_current_mode", "system_export", "system_policy_type", "system_relabel" ]
+
+        if self.opage == LOCKDOWN_PAGE:
+                self.help_window.set_title(_("Help: Lockdown Page"))
+                self.help_list = [ "lockdown", "lockdown_unconfined", "lockdown_permissive", "lockdown_ptrace" ]
+
+        if self.opage == LOGIN_PAGE:
+                self.help_window.set_title(_("Help: Login Page"))
+                self.help_list = [ "login", "login_default" ]
+
+        if self.opage == USER_PAGE:
+                self.help_window.set_title(_("Help: SELinux User Page"))
+                self.help_list = [ "users" ]
+
+        if self.opage == FILE_EQUIV_PAGE:
+                self.help_window.set_title(_("Help: File Equivalence Page"))
+                self.help_list = [ "file_equiv"]
+        return self.help_show_page()
+
+    def open_combo_menu(self, *args):
+        if self.popup == 0:
+            self.popup = 1
+            location = self.window.get_position()
+            self.main_selection_window.move(location[0]+2, location[1]+65)
+            self.main_selection_window.show()
+        else:
+            self.main_selection_window.hide()
+            self.popup = 0
+
+    def hide_combo_menu(self, *args):
+        self.main_selection_window.hide()
+        self.popup = 0
+
+    def set_application_label(self, *args):
+        self.set_application_label = True
+
+    def resize_wrap(self, *args):
+        print args
+
+    def initialize_system_default_mode(self):
+        self.enforce_mode = selinux.selinux_getenforcemode()[1]
+        if self.enforce_mode == ENFORCING:
+            self.enforce_button = self.enforcing_button_default
+        if self.enforce_mode == PERMISSIVE:
+            self.enforce_button = self.permissive_button_default
+        if self.enforce_mode == DISABLED:
+            self.enforce_button = self.disabled_button_default
+
+    def populate_system_policy(self):
+        selinux_path = selinux.selinux_path()
+        types = map(lambda x: x[1], filter(lambda x: x[0]==selinux_path, os.walk(selinux_path)))[0]
+        types.sort()
+        ctr = 0
+        for item in types:
+            iter = self.system_policy_type_liststore.append()
+            self.system_policy_type_liststore.set_value(iter, 0, item)
+            if item == self.initialtype:
+                self.system_policy_type_combobox.set_active(ctr)
+                self.typeHistory = ctr
+            ctr += 1
+        return ctr
+
+    def filter_the_data(self, list, iter, *args):
+        # When there is no txt in the box show all items in the tree
+        if self.filter_txt == "":
+            return True
+        try:
+            for x in range(0,list.get_n_columns()):
+                try:
+                    val = list.get_value(iter, x)
+                    if val == True or val == False or val == None:
+                        continue
+                    # Returns true if filter_txt exists within the val
+                    if(val.find(self.filter_txt) != -1 or val.lower().find(self.filter_txt) != -1) :
+                        return True
+                except AttributeError, TypeError:
+                    pass
+        except: #ValueError:
+            pass
+        return False
+
+    def net_update(self, app, netd, protocol, direction, model):
+        for k in netd.keys():
+            for t,ports in netd[k]:
+                pkey = (",".join(ports), protocol)
+                if pkey in self.cur_dict["port"]:
+                    if self.cur_dict["port"][pkey]["action"] == "-d":
+                        continue
+                    if t != self.cur_dict["port"][pkey]["type"]:
+                        continue
+                self.network_initial_data_insert(model, ", ".join(ports), t, protocol)
+
+    def file_equiv_initialize(self):
+        self.wait_mouse()
+        edict = sepolicy.get_file_equiv()
+        self.file_equiv_liststore.clear()
+        for f in edict:
+            iter = self.file_equiv_liststore.append()
+            if edict[f]["modify"]:
+                name = self.markup(f)
+                equiv = self.markup(edict[f]["equiv"])
+            else:
+                name = f
+                equiv = edict[f]["equiv"]
+
+            self.file_equiv_liststore.set_value(iter, 0, name)
+            self.file_equiv_liststore.set_value(iter, 1, equiv)
+            self.file_equiv_liststore.set_value(iter, 2, edict[f]["modify"])
+        self.ready_mouse()
+
+    def user_initialize(self):
+        self.wait_mouse()
+        self.user_liststore.clear()
+        for u in sepolicy.get_selinux_users():
+            iter = self.user_liststore.append()
+            self.user_liststore.set_value(iter, 0, str(u["name"]))
+            roles = u["roles"]
+            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, 4, True)
+        self.ready_mouse()
+
+    def login_initialize(self):
+        self.wait_mouse()
+        self.login_liststore.clear()
+        for u in sepolicy.get_login_mappings():
+            iter = self.login_liststore.append()
+            self.login_liststore.set_value(iter, 0, u["name"])
+            self.login_liststore.set_value(iter, 1, u["seuser"])
+            self.login_liststore.set_value(iter, 2, u["mls"])
+            self.login_liststore.set_value(iter, 3, True)
+        self.ready_mouse()
+
+    def network_initialize(self, app):
+        netd = sepolicy.network.get_network_connect(app, "tcp", "name_connect")
+        self.net_update(app, netd, "tcp", OUTBOUND_PAGE, self.network_out_liststore)
+        netd = sepolicy.network.get_network_connect(app, "tcp", "name_bind")
+        self.net_update(app, netd, "tcp", INBOUND_PAGE, self.network_in_liststore)
+        netd = sepolicy.network.get_network_connect(app, "udp", "name_bind")
+        self.net_update(app, netd, "udp", INBOUND_PAGE, self.network_in_liststore)
+
+    def network_initial_data_insert(self, model, ports, portType, protocol):
+        iter = model.append()
+        model.set_value(iter, 0, ports)
+        model.set_value(iter, 1, protocol)
+        model.set_value(iter, 2, portType)
+        model.set_value(iter, 4, True)
+
+    def combo_set_active_text(self, combobox, val):
+        ctr = 0
+        liststore = combobox.get_model()
+        for i in liststore:
+            if i[0] == val:
+                combobox.set_active(ctr)
+                return
+            ctr += 1
+
+        niter = liststore.get_iter(ctr-1)
+        if liststore.get_value(niter, 0) == _("More..."):
+            iter = liststore.insert_before(niter)
+            ctr = ctr - 1
+        else:
+            iter = liststore.append()
+        liststore.set_value(iter, 0, val)
+        combobox.set_active(ctr)
+
+    def combo_get_active_text(self, combobox):
+        liststore = combobox.get_model()
+        index = combobox.get_active()
+        if index < 0:
+            return None
+        iter = liststore.get_iter(index)
+        return liststore.get_value(iter, 0)
+
+    def combo_box_initialize(self, val, desc):
+        if val == None:
+            return
+        iter = self.combobox_menu_model.append()
+        for f in val:
+            self.combobox_menu_model.set_value(iter, 0, val)
+
+    def select_type_more(self, *args):
+        app = self.moreTypes_treeview.get_selection()
+        iter = app.get_selected()[1]
+        if iter == None:
+            return
+        app = self.more_types_files_liststore.get_value(iter, 0)
+        self.combo_set_active_text(self.files_type_combobox, app)
+        self.closewindow(self.moreTypes_window_files)
+
+    def advanced_item_button_push(self, *args):
+        row = self.advanced_search_treeview.get_selection()
+        model, iter = row.get_selected()
+        iter = model.convert_iter_to_child_iter(iter)
+        iter = self.advanced_search_filter.convert_iter_to_child_iter(iter)
+        app = self.advanced_search_liststore.get_value(iter, 1)
+        if app == None:
+            return
+        self.advanced_filter_entry.set_text('')
+        self.advanced_search_window.hide()
+        self.reveal_advanced(self.main_advanced_label)
+        self.completion_entry.set_text(app)
+        self.application_selected()
+
+    def advanced_item_selected(self, treeview, path, *args):
+        iter = self.advanced_search_filter.get_iter(path)
+        iter = self.advanced_search_filter.convert_iter_to_child_iter(iter)
+        app = self.advanced_search_liststore.get_value(iter, 1)
+        self.advanced_filter_entry.set_text('')
+        self.advanced_search_window.hide()
+        self.reveal_advanced(self.main_advanced_label)
+        self.completion_entry.set_text(app)
+        self.application_selected()
+
+    def find_application(self, app):
+        if app and len(app) > 0:
+            for items in self.combobox_menu_model:
+                if app == items[0]:
+                    return True
+        return False
+
+    def application_selected(self, *args):
+        self.show_mislabeled_files_only.set_visible(False)
+        self.mislabeled_files_label.set_visible(False)
+        self.warning_files.set_visible(False)
+        self.filter_entry.set_text('')
+
+        app = self.completion_entry.get_text()
+        if not self.find_application(app):
+            return
+        self.show_applications_page()
+        self.add_button.set_sensitive(True)
+        self.delete_button.set_sensitive(True)
+        # Clear the tree to prepare for a new selection otherwise
+        self.executable_files_liststore.clear()
+        # data will pile up everytime the user selects a new item from the drop down menu
+        self.network_in_liststore.clear()
+        self.network_out_liststore.clear()
+        self.boolean_liststore.clear()
+        self.transitions_into_liststore.clear()
+        self.transitions_from_treestore.clear()
+        self.application_files_liststore.clear()
+        self.writable_files_liststore.clear()
+        self.transitions_file_liststore.clear()
+
+        try:
+            if app[0] == '/':
+                app = sepolicy.get_init_transtype(app)
+                if not app:
+                    return
+                self.application = app
+        except IndexError:
+            pass
+
+        self.wait_mouse()
+        self.previously_modified_initialize(self.dbus.customized())
+        self.reinit()
+        self.boolean_initialize(app)
+        self.mislabeled_files = False
+        self.executable_files_initialize(app)
+        self.network_initialize(app)
+        self.writable_files_initialize(app)
+        self.transitions_into_initialize(app)
+        self.transitions_from_initialize(app)
+        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.transitions_into_tab.set_tooltip_text(_("Executables which will transition to the '%s', when executing a selected domains entrypoint.") % app)
+        self.transitions_from_tab.set_tooltip_text(_("Executables which will transition to a different domain, when the '%s' executes them.") % app)
+        self.transitions_file_tab.set_tooltip_text(_("Files by '%s' will 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)
+        self.ready_mouse()
+
+    def reinit(self):
+        sepolicy.reinit()
+        self.fcdict=sepolicy.get_fcdict()
+        self.local_file_paths = sepolicy.get_local_file_paths()
+
+    def previously_modified_initialize(self, buf):
+        self.cust_dict = {}
+        for i in buf.split("\n"):
+            rec = i.split()
+            if len(rec) == 0:
+                continue
+            if rec[1] == "-D":
+                continue
+            if rec[0] not in self.cust_dict:
+                self.cust_dict[rec[0]] = {}
+            if rec[0] == "boolean":
+                self.cust_dict["boolean"][rec[-1]] = { "active": rec[2] == "-1" }
+            if rec[0] == "login":
+                self.cust_dict["login"][rec[-1]] = { "seuser": rec[3], "range": rec[5] }
+            if rec[0] == "interface":
+                self.cust_dict["interface"][rec[-1]] = { "type": rec[3] }
+            if rec[0] == "user":
+                self.cust_dict["user"][rec[-1]] = { "level": "s0", "range": rec[3], "role": rec[5] }
+            if rec[0] == "port":
+                self.cust_dict["port"][(rec[-1], rec[-2] )] = { "type": rec[3] }
+            if rec[0] == "node":
+                self.cust_dict["node"][rec[-1]] = { "mask": rec[3], "protocol":rec[5], "type": rec[7] }
+            if rec[0] == "fcontext":
+                if rec[2] == "-e":
+                    if "fcontext-equiv" not in self.cust_dict:
+                        self.cust_dict["fcontext-equiv"] = {}
+                    self.cust_dict["fcontext-equiv"][(rec[-1])] = { "equiv": rec[3] }
+                else:
+                    self.cust_dict["fcontext"][(rec[-1],rec[3])] = { "type": rec[5] }
+            if rec[0] == "module":
+                self.cust_dict["module"][rec[-1]] = { "enabled": rec[2] != "-d" }
+
+        if "module" not in self.cust_dict:
+            return
+        for semodule, button in [ ("unconfined", self.disable_unconfined_button), ("permissivedomains", self.disable_permissive_button) ]:
+            if semodule in self.cust_dict["module"]:
+                button.set_active(self.cust_dict["module"][semodule]["enabled"])
+
+        for i in keys:
+            if i not in self.cust_dict:
+                self.cust_dict.update({i:{}})
+
+    def executable_files_initialize(self, application):
+        self.entrypoints = sepolicy.get_entrypoints(application)
+        for exe in self.entrypoints.keys():
+            if len(self.entrypoints[exe]) == 0:
+                continue
+            file_class = self.entrypoints[exe][1]
+            for path in self.entrypoints[exe][0]:
+                if (path, file_class) in self.cur_dict["fcontext"]:
+                    if self.cur_dict["fcontext"][(path, file_class)]["action"] == "-d":
+                        continue
+                    if exe != self.cur_dict["fcontext"][(path, file_class)]["type"]:
+                        continue
+                self.files_initial_data_insert(self.executable_files_liststore, path, exe, file_class)
+
+    def mislabeled(self, path):
+        try:
+            con = selinux.matchpathcon(path,0)[1]
+            cur = selinux.getfilecon(path)[1]
+            return con != cur
+        except OSError:
+            return False
+
+    def set_mislabeled(self, tree, path, iter, niter):
+        if not self.mislabeled(path):
+            return
+        con = selinux.matchpathcon(path,0)[1]
+        cur = selinux.getfilecon(path)[1]
+        self.mislabeled_files=True
+        # Set visibility of label
+        tree.set_value(niter, 3, True)
+        # Has a mislabel
+        tree.set_value(iter, 4, True)
+        tree.set_value(niter, 4, True)
+        tree.set_value(iter, 5, con.split(":")[2])
+        tree.set_value(iter, 6, cur.split(":")[2])
+
+    def writable_files_initialize(self, application):
+        # Traversing the dictionary data struct
+        self.writable_files = sepolicy.get_writable_files(application)
+        for write in self.writable_files.keys():
+            if len(self.writable_files[write]) < 2:
+                self.files_initial_data_insert(self.writable_files_liststore, None, write, _("all files"))
+                continue
+            file_class = self.writable_files[write][1]
+            for path in self.writable_files[write][0]:
+                if (path,file_class) in self.cur_dict["fcontext"]:
+                    if self.cur_dict["fcontext"][(path,file_class) ]["action"] == "-d":
+                        continue
+                    if write != self.cur_dict["fcontext"][(path, file_class)]["type"]:
+                        continue
+                self.files_initial_data_insert(self.writable_files_liststore, path, write, file_class)
+
+    def files_initial_data_insert(self, liststore, path, seLinux_label, file_class):
+        iter = liststore.append(None)
+        if path == None:
+            path = _("MISSING FILE PATH")
+            modify = False
+        else:
+            modify = (path,file_class) in self.local_file_paths
+            for p in sepolicy.find_file(path):
+                niter = liststore.append(iter)
+                liststore.set_value(niter, 0, p)
+                self.set_mislabeled(liststore, p, iter, niter)
+            if modify:
+                path = self.markup(path)
+                file_class = self.markup(selinux_label)
+                file_class = self.markup(file_class)
+        liststore.set_value(iter, 0, path)
+        liststore.set_value(iter, 1, seLinux_label)
+        liststore.set_value(iter, 2, file_class)
+        liststore.set_value(iter, 7, modify)
+
+    def markup(self, f):
+        return "<b>%s</b>" % f
+
+    def unmarkup(self, f):
+        if f:
+            return re.sub("</b>$","", re.sub("^<b>","", f))
+        return None
+
+    def application_files_initialize(self, application):
+        self.file_types = sepolicy.get_file_types(application)
+        for app in self.file_types.keys():
+            if len(self.file_types[app]) == 0:
+                continue
+            file_class = self.file_types[app][1]
+            for path in self.file_types[app][0]:
+                desc = sepolicy.get_description(app, markup = self.markup)
+                if (path, file_class) in self.cur_dict["fcontext"]:
+                    if self.cur_dict["fcontext"][(path, file_class)]["action"] == "-d":
+                        continue
+                    if app != self.cur_dict["fcontext"][(path, file_class)]["type"]:
+                        continue
+                self.files_initial_data_insert(self.application_files_liststore, path, desc, file_class)
+
+    def modified(self):
+        i = 0
+        for k in self.cur_dict:
+            if len(self.cur_dict[k]) > 0:
+                return True
+        return False
+
+    def boolean_initialize(self, application):
+        for blist in sepolicy.get_bools(application):
+            for b, active in blist:
+                if b in self.cur_dict["boolean"]:
+                    active = self.cur_dict["boolean"][b]['active']
+                desc = sepolicy.boolean_desc(b)
+                self.boolean_initial_data_insert(b, desc , active)
+
+    def boolean_initial_data_insert(self, val, desc, active):
+        # Insert data from data source into tree
+        iter = self.boolean_liststore.append()
+        self.boolean_liststore.set_value(iter, 0, active)
+        self.boolean_liststore.set_value(iter, 1, desc)
+        self.boolean_liststore.set_value(iter, 2, val)
+        self.boolean_liststore.set_value(iter, 3, _('More...'))
+
+    def transitions_into_initialize(self, application):
+        for x in sepolicy.get_transitions_into(application):
+            active = None
+            executable = None
+            source = None
+            if "boolean" in x:
+                active = x["boolean"]
+            if "target" in x:
+                executable = x["target"]
+            if "source" in x:
+                source = x["source"]
+            self.transitions_into_initial_data_insert(active, executable, source)
+
+    def transitions_into_initial_data_insert(self, active, executable, source):
+        iter = self.transitions_into_liststore.append()
+        if active != None:
+            self.transitions_into_liststore.set_value(iter, 0, enabled[active[0][1]])         # active[0][1] is either T or F (enabled is all the way at the top)
+        else:
+            self.transitions_into_liststore.set_value(iter, 0, "Default")
+
+        self.transitions_into_liststore.set_value(iter, 2, executable)
+        self.transitions_into_liststore.set_value(iter, 1, source)
+
+    def transitions_from_initialize(self, application):
+        for x in sepolicy.get_transitions(application):
+            active = None
+            executable = None
+            transtype = None
+            if "boolean" in x:
+                active = x["boolean"]
+            if "target" in x:
+                executable_type = x["target"]
+            if "transtype" in x:
+                transtype = x["transtype"]
+            self.transitions_from_initial_data_insert(active, executable_type, transtype)
+            try:
+                for executable in self.fcdict[executable_type]["regex"]:
+                    self.transitions_from_initial_data_insert(active, executable, transtype)
+            except KeyError:
+                pass
+
+    def transitions_from_initial_data_insert(self, active, executable, transtype):
+        iter = self.transitions_from_treestore.append(None)
+        if active == None:
+            self.transitions_from_treestore.set_value(iter, 0, "Default")
+            self.transitions_from_treestore.set_value(iter, 5, False)
+        else:
+            niter = self.transitions_from_treestore.append(iter)
+            # active[0][1] is either T or F (enabled is all the way at the top)
+            self.transitions_from_treestore.set_value(iter, 0, enabled[active[0][1]])
+            markup = '<span foreground="blue"><u>%s</u></span>'
+            if active[0][1]:
+                self.transitions_from_treestore.set_value(niter, 2, (_("To disable this transition, go to the " + markup % _("Boolean section."))))
+            else:
+                self.transitions_from_treestore.set_value(niter, 2, (_("To enable this transition, go to the " + markup % _("Boolean section."))))
+
+            # active[0][0] is the Bool Name
+            self.transitions_from_treestore.set_value(niter, 1, active[0][0])
+            self.transitions_from_treestore.set_value(niter, 5, True)
+
+        self.transitions_from_treestore.set_value(iter, 2, executable)
+        self.transitions_from_treestore.set_value(iter, 3, transtype)
+
+    def transitions_files_initialize(self, application):
+        for i in sepolicy.get_file_transitions(application):
+            if 'filename' in i:
+                filename = i['filename']
+            else:
+                filename = None
+            self.transitions_files_inital_data_insert(i['target'], i['class'], i['transtype'], filename)
+
+    def transitions_files_inital_data_insert(self, path, tclass, dest, name):
+        iter = self.transitions_file_liststore.append()
+        self.transitions_file_liststore.set_value(iter, 0, path)
+        self.transitions_file_liststore.set_value(iter, 1, tclass)
+        self.transitions_file_liststore.set_value(iter, 2, dest)
+        if name == None:
+            name = '*'
+        self.transitions_file_liststore.set_value(iter, 3, name)
+
+    def tab_change(self, *args):
+        self.clear_filters()
+        self.treeview = None
+        self.treesort = None
+        self.treefilter = None
+        self.liststore = None
+        self.modify_button.set_sensitive(False)
+        self.add_modify_delete_box.hide()
+        self.show_modified_only.set_visible(False)
+        self.show_mislabeled_files_only.set_visible(False)
+        self.mislabeled_files_label.set_visible(False)
+        self.warning_files.set_visible(False)
+
+        if self.boolean_radio_button.get_active():
+            self.outer_notebook.set_current_page(BOOLEANS_PAGE)
+            self.treeview = self.boolean_treeview
+            self.show_modified_only.set_visible(True)
+
+        if self.files_radio_button.get_active():
+            self.show_popup(self.add_modify_delete_box)
+            self.show_modified_only.set_visible(True)
+            self.show_mislabeled_files_only.set_visible(self.mislabeled_files)
+            self.mislabeled_files_label.set_visible(self.mislabeled_files)
+            self.warning_files.set_visible(self.mislabeled_files)
+            self.outer_notebook.set_current_page(FILES_PAGE)
+            if args[0] == self.inner_notebook_files:
+                ipage = args[2]
+            else:
+                ipage = self.inner_notebook_files.get_current_page()
+            if ipage == EXE_PAGE:
+                self.treeview = self.executable_files_treeview
+                category = _("executable")
+            elif ipage == WRITABLE_PAGE:
+                self.treeview = self.writable_files_treeview
+                category = _("writable")
+            elif ipage == APP_PAGE:
+                self.treeview = self.application_files_treeview
+                category = _("application")
+            self.add_button.set_tooltip_text(_("Add new %(TYPE)s file path for '%(DOMAIN)s' domains.") % { "TYPE": category, "DOMAIN": self.application})
+            self.delete_button.set_tooltip_text(_("Delete %(TYPE)s file paths for '%(DOMAIN)s' domain.") % { "TYPE": category, "DOMAIN": self.application})
+            self.modify_button.set_tooltip_text(_("Modify %(TYPE)s file path for '%(DOMAIN)s' domain. Only bolded items in the list can be selected, this indicates they were modified previously.") % { "TYPE": category, "DOMAIN": self.application})
+
+        if self.network_radio_button.get_active():
+            self.add_modify_delete_box.show()
+            self.show_modified_only.set_visible(True)
+            self.outer_notebook.set_current_page(NETWORK_PAGE)
+            if args[0] == self.inner_notebook_network:
+                ipage = args[2]
+            else:
+                ipage = self.inner_notebook_network.get_current_page()
+            if ipage == OUTBOUND_PAGE:
+                self.treeview = self.network_out_treeview
+                category = _("connect")
+            if ipage == INBOUND_PAGE:
+                self.treeview = self.network_in_treeview
+                category = _("listen for inbound connections")
+
+            self.add_button.set_tooltip_text(_("Add new port definition to which the '%(APP)s' domain is allowed to %s.") % {"APP": self.application, "PERM": category})
+            self.delete_button.set_tooltip_text(_("Delete modified port definitions to which the '%(APP)s' domain is allowed to %s.") % {"APP": self.application, "PERM": category})
+            self.modify_button.set_tooltip_text(_("Modify port definitions to which the '%(APP)s' domain is allowed to %(PERM)s.") % {"APP": self.application, "PERM": category})
+
+        if self.transitions_radio_button.get_active():
+            self.outer_notebook.set_current_page(TRANSITIONS_PAGE)
+            if args[0] == self.inner_notebook_transitions:
+                ipage = args[2]
+            else:
+                ipage = self.inner_notebook_transitions.get_current_page()
+            if ipage == TRANSITIONS_FROM_PAGE:
+                self.treeview = self.transitions_from_treeview
+            if ipage == TRANSITIONS_TO_PAGE:
+                self.treeview = self.transitions_into_treeview
+            if ipage == TRANSITIONS_FILE_PAGE:
+                self.treeview = self.transitions_file_treeview
+
+        if self.system_radio_button.get_active():
+            self.outer_notebook.set_current_page(SYSTEM_PAGE)
+            self.filter_box.hide()
+
+        if self.lockdown_radio_button.get_active():
+            self.lockdown_init()
+            self.outer_notebook.set_current_page(LOCKDOWN_PAGE)
+            self.filter_box.hide()
+
+        if self.user_radio_button.get_active():
+            self.outer_notebook.set_current_page(USER_PAGE)
+            self.add_modify_delete_box.show()
+            self.show_modified_only.set_visible(True)
+            self.treeview = self.user_treeview
+            self.add_button.set_tooltip_text(_("Add new SELinux User/Role definition."))
+            self.delete_button.set_tooltip_text(_("Delete modified SELinux User/Role definitions."))
+            self.modify_button.set_tooltip_text(_("Modify selected modified SELinux User/Role definitions."))
+
+        if self.login_radio_button.get_active():
+            self.outer_notebook.set_current_page(LOGIN_PAGE)
+            self.add_modify_delete_box.show()
+            self.show_modified_only.set_visible(True)
+            self.treeview = self.login_treeview
+            self.add_button.set_tooltip_text(_("Add new Login Mapping definition."))
+            self.delete_button.set_tooltip_text(_("Delete modified Login Mapping definitions."))
+            self.modify_button.set_tooltip_text(_("Modify selected modified Login Mapping definitions."))
+
+        if self.file_equiv_radio_button.get_active():
+            self.outer_notebook.set_current_page(FILE_EQUIV_PAGE)
+            self.add_modify_delete_box.show()
+            self.show_modified_only.set_visible(True)
+            self.treeview = self.file_equiv_treeview
+            self.add_button.set_tooltip_text(_("Add new File Equivalence definition."))
+            self.delete_button.set_tooltip_text(_("Delete modified File Equivalence definitions."))
+            self.modify_button.set_tooltip_text(_("Modify selected modified File Equivalence definitions. Only bolded items in the list can be selected, this indicates they were modified previously."))
+
+        self.opage = self.outer_notebook.get_current_page()
+        if self.treeview:
+            self.filter_box.show()
+            self.treesort = self.treeview.get_model()
+            self.treefilter = self.treesort.get_model()
+            self.liststore = self.treefilter.get_model()
+            for x in range(0,self.liststore.get_n_columns()):
+                col = self.treeview.get_column(x)
+                if col:
+                    cell = col.get_cells()[0]
+                    if isinstance(cell,Gtk.CellRendererText):
+                        self.liststore.set_sort_func(x, self.stripsort, None)
+            self.treeview.get_selection().unselect_all()
+        self.modify_button.set_sensitive(False)
+
+    def stripsort(self, model, row1, row2, user_data):
+        sort_column, _ = model.get_sort_column_id()
+        val1 = self.unmarkup(model.get_value(row1, sort_column))
+        val2 = self.unmarkup(model.get_value(row2, sort_column))
+        return cmp(val1,val2)
+
+    def display_more_detail(self, windows, path):
+        it = self.boolean_filter.get_iter(path)
+        it = self.boolean_filter.convert_iter_to_child_iter(it)
+
+        self.boolean_more_detail_tree_data_set.clear()
+        self.boolean_more_detail_window.set_title(_("Boolean %s Allow Rules") % self.boolean_liststore.get_value(it, 2))
+        blist = sepolicy.get_boolean_rules(self.application,self.boolean_liststore.get_value(it, 2));
+        for b in blist:
+            self.display_more_detail_init(b["source"], b["target"], b["class"], b["permlist"])
+        self.show_popup(self.boolean_more_detail_window)
+
+    def display_more_detail_init(self, source, target, class_type, permission):
+        iter = self.boolean_more_detail_tree_data_set.append()
+        self.boolean_more_detail_tree_data_set.set_value(iter, 0, "allow %s %s:%s { %s };" % (source, target, class_type, " ".join(permission)))
+
+    def add_button_clicked(self, *args):
+        self.modify = False
+        if self.opage == NETWORK_PAGE:
+            self.popup_network_label.set_text((_("Add Network Port for %s.  Ports will be created when update is applied."))% self.application)
+            self.network_popup_window.set_title((_("Add Network Port for %s"))% self.application)
+            self.init_network_dialog(args)
+            return
+
+        if self.opage == FILES_PAGE:
+            self.popup_files_label.set_text((_("Add File Labeling for %s. File labels will be created when update is applied."))% self.application)
+            self.files_popup_window.set_title((_("Add File Labeling for %s"))% self.application)
+            self.init_files_dialog(args)
+            ipage = self.inner_notebook_files.get_current_page()
+            if ipage == EXE_PAGE:
+                self.files_path_entry.set_text("ex: /usr/sbin/Foobar")
+            else:
+                self.files_path_entry.set_text("ex: /var/lib/Foobar")
+            self.clear_entry = True
+
+        if self.opage == LOGIN_PAGE:
+            self.login_label.set_text((_("Add Login Mapping. User Mapping will be created when Update is applied.")))
+            self.login_popup_window.set_title(_("Add Login Mapping"))
+            self.login_init_dialog(args)
+            self.clear_entry = True
+
+        if self.opage == USER_PAGE:
+            self.user_label.set_text((_("Add SELinux User Role. SELinux user roles will be created when update is applied.")))
+            self.user_popup_window.set_title(_("Add SELinux Users"))
+            self.user_init_dialog(args)
+            self.clear_entry = True
+
+        if self.opage == FILE_EQUIV_PAGE:
+            self.file_equiv_source_entry.set_text("")
+            self.file_equiv_dest_entry.set_text("")
+            self.file_equiv_label.set_text((_("Add File Equivalency Mapping. Mapping will be created when update is applied.")))
+            self.file_equiv_popup_window.set_title(_("Add SELinux File Equivalency"))
+            self.clear_entry = True
+            self.show_popup(self.file_equiv_popup_window)
+
+        self.new_updates()
+
+    def show_popup(self, window):
+        self.current_popup = window
+        window.show()
+
+    def close_popup(self, *args):
+        self.current_popup.hide()
+        self.window.set_sensitive(True)
+        return True
+
+    def modify_button_clicked(self, *args):
+        iter = None
+        if self.treeview:
+            iter = self.get_selected_iter()
+            if not iter:
+                self.modify_button.set_sensitive(False)
+                return
+        self.modify = True
+        if self.opage == NETWORK_PAGE:
+            self.modify_button_network_clicked(args)
+
+        if self.opage == FILES_PAGE:
+            self.popup_files_label.set_text((_("Modify File Labeling for %s. File labels will be created when update is applied."))% self.application)
+            self.files_popup_window.set_title((_("Add File Labeling for %s"))% self.application)
+            self.delete_old_item = None
+            self.init_files_dialog(args)
+            self.modify = True
+            operation = "Modify"
+            mls = 1
+            ipage = self.inner_notebook_files.get_current_page()
+
+            if ipage == EXE_PAGE:
+                iter = self.executable_files_filter.convert_iter_to_child_iter(iter)
+                self.delete_old_item = iter
+                path = self.executable_files_liststore.get_value(iter, 0)
+                self.files_path_entry.set_text(path)
+                ftype = self.executable_files_liststore.get_value(iter, 1)
+                if type != None:
+                    self.combo_set_active_text(self.files_type_combobox, ftype)
+                tclass = self.executable_files_liststore.get_value(iter, 2)
+                if tclass != None:
+                    self.combo_set_active_text(self.files_class_combobox, tclass)
+
+            if ipage == WRITABLE_PAGE:
+                iter = self.writable_files_filter.convert_iter_to_child_iter(iter)
+                self.delete_old_item = iter
+                path = self.writable_files_liststore.get_value(iter, 0)
+                self.files_path_entry.set_text(path)
+                type = self.writable_files_liststore.get_value(iter, 1)
+                if type != None:
+                    self.combo_set_active_text(self.files_type_combobox, type)
+                tclass = self.writable_files_liststore.get_value(iter, 2)
+                if tclass != None:
+                    self.combo_set_active_text(self.files_class_combobox, tclass)
+
+            if ipage == APP_PAGE:
+                iter = self.application_files_filter.convert_iter_to_child_iter(iter)
+                self.delete_old_item = iter
+                path = self.application_files_liststore.get_value(iter, 0)
+                self.files_path_entry.set_text(path)
+                try:
+                    get_type = self.application_files_liststore.get_value(iter, 1)
+                    get_type = get_type.split("<b>")[1].split("</b>")
+                except AttributeError:
+                    pass
+                type = self.application_files_liststore.get_value(iter, 2)
+                if type != None:
+                    self.combo_set_active_text(self.files_type_combobox, type)
+                tclass = get_type[0]
+                if tclass != None:
+                    self.combo_set_active_text(self.files_class_combobox, tclass)
+
+        if self.opage == USER_PAGE:
+            self.user_init_dialog(args)
+            self.user_name_entry.set_text(self.user_liststore.get_value(iter,0))
+            self.user_mls_level_entry.set_text(self.user_liststore.get_value(iter,2))
+            self.user_mls_entry.set_text(self.user_liststore.get_value(iter,3))
+            self.combo_set_active_text(self.user_roles_combobox, self.user_liststore.get_value(iter,1))
+            self.user_label.set_text((_("Modify SELinux User Role. SELinux user roles will be modified when update is applied.")))
+            self.user_popup_window.set_title(_("Modify SELinux Users"))
+            self.show_popup(self.user_popup_window)
+
+        if self.opage == LOGIN_PAGE:
+            self.login_init_dialog(args)
+            self.login_name_entry.set_text(self.login_liststore.get_value(iter,0))
+            self.login_mls_entry.set_text(self.login_liststore.get_value(iter,2))
+            self.combo_set_active_text(self.login_seuser_combobox, self.login_liststore.get_value(iter,1))
+            self.login_label.set_text((_("Modify Login Mapping. Login Mapping will be modified when Update is applied.")))
+            self.login_popup_window.set_title(_("Modify Login Mapping"))
+            self.show_popup(self.login_popup_window)
+
+        if self.opage == FILE_EQUIV_PAGE:
+            self.file_equiv_source_entry.set_text(self.file_equiv_liststore.get_value(iter,0))
+            self.file_equiv_dest_entry.set_text(self.file_equiv_liststore.get_value(iter,1))
+            self.file_equiv_label.set_text((_("Modify File Equivalency Mapping. Mapping will be created when update is applied.")))
+            self.file_equiv_popup_window.set_title(_("Modify SELinux File Equivalency"))
+            self.clear_entry = True
+            self.show_popup(self.file_equiv_popup_window)
+
+    def populate_type_combo(self, tree, loc, *args):
+        iter = self.more_types_files_liststore.get_iter(loc)
+        ftype = self.more_types_files_liststore.get_value(iter, 0)
+        self.combo_set_active_text(self.files_type_combobox, ftype)
+        self.show_popup(self.files_popup_window)
+        self.moreTypes_window_files.hide()
+
+    def strip_domain(self, domain):
+        if domain == None:
+            return
+        if domain.endswith("_script_t"):
+            split_char="_script_t"
+        else:
+            split_char="_t"
+        return domain.split(split_char)[0]
+
+    def exclude_type(self, type, exclude_list):
+        for e in exclude_list:
+            if type.startswith(e):
+                return True
+        return False
+
+    def init_files_dialog(self, *args):
+        exclude_list = []
+        self.files_class_combobox.set_sensitive(True)
+        self.show_popup(self.files_popup_window)
+        ipage = self.inner_notebook_files.get_current_page()
+        self.files_type_combolist.clear()
+        self.files_class_combolist.clear()
+        compare = self.strip_domain(self.application)
+        for d in self.completion_entry_model:
+            if d[0].startswith(compare) and d[0] != self.application and not d[0].startswith("httpd_sys"):
+                exclude_list.append(self.strip_domain(d[0]))
+
+        self.more_types_files_liststore.clear()
+        try:
+            for files in sepolicy.file_type_str:
+                iter = self.files_class_combolist.append()
+                self.files_class_combolist.set_value(iter, 0, sepolicy.file_type_str[files])
+
+            if ipage == EXE_PAGE and self.entrypoints != None:
+                for exe in self.entrypoints.keys():
+                    if exe.startswith(compare):
+                        iter = self.files_type_combolist.append()
+                        self.files_type_combolist.set_value(iter, 0, exe)
+                    iter = self.more_types_files_liststore.append()
+                    self.more_types_files_liststore.set_value(iter, 0, exe)
+                self.files_class_combobox.set_active(4)
+                self.files_class_combobox.set_sensitive(False)
+
+            elif ipage == WRITABLE_PAGE and self.writable_files != None:
+                for write in self.writable_files.keys():
+                    if write.startswith(compare) and not self.exclude_type(write, exclude_list) and write in self.file_types:
+                        iter = self.files_type_combolist.append()
+                        self.files_type_combolist.set_value(iter, 0, write)
+                    iter = self.more_types_files_liststore.append()
+                    self.more_types_files_liststore.set_value(iter, 0, write)
+                self.files_class_combobox.set_active(0)
+            elif ipage == APP_PAGE and self.file_types != None:
+                for app in sepolicy.get_all_file_types():
+                    if app.startswith(compare):
+                        if app.startswith(compare) and not self.exclude_type(app, exclude_list):
+                            iter = self.files_type_combolist.append()
+                            self.files_type_combolist.set_value(iter, 0, app)
+                        iter = self.more_types_files_liststore.append()
+                        self.more_types_files_liststore.set_value(iter, 0, app)
+                self.files_class_combobox.set_active(0)
+        except AttributeError:
+            print "error"
+            pass
+        self.files_type_combobox.set_active(0)
+        self.files_mls_entry.set_text("s0")
+        iter = self.files_type_combolist.append()
+        self.files_type_combolist.set_value(iter, 0, _('More...'))
+
+    def modify_button_network_clicked(self, *args):
+        iter = self.get_selected_iter()
+        if not iter:
+            self.modify_button.set_sensitive(False)
+            return
+
+        self.popup_network_label.set_text((_("Modify Network Port for %s.  Ports will be created when update is applied."))% self.application)
+        self.network_popup_window.set_title((_("Modify Network Port for %s"))% self.application)
+        self.delete_old_item = None
+        self.init_network_dialog(args)
+        operation = "Modify"
+        mls = 1
+        self.modify = True
+        iter = self.get_selected_iter()
+        port = self.liststore.get_value(iter, 0)
+        self.network_ports_entry.set_text(port)
+        protocol = self.liststore.get_value(iter, 1)
+        if protocol == "tcp":
+            self.network_tcp_button.set_active(True)
+        elif protocol == "udp":
+            self.network_udp_button.set_active(True)
+        type = self.liststore.get_value(iter, 2)
+        if type != None:
+            self.combo_set_active_text(self.network_port_type_combobox, type)
+        self.delete_old_item = iter
+
+    def init_network_dialog(self, *args):
+        self.show_popup(self.network_popup_window)
+        ipage = self.inner_notebook_network.get_current_page()
+        self.network_port_type_combolist.clear()
+        self.network_ports_entry.set_text("")
+
+        try:
+            if ipage == OUTBOUND_PAGE:
+                netd = sepolicy.network.get_network_connect(self.application, "tcp", "name_connect")
+            elif ipage == INBOUND_PAGE:
+                netd = sepolicy.network.get_network_connect(self.application, "tcp", "name_bind")
+                netd += sepolicy.network.get_network_connect(self.application, "udp", "name_bind")
+
+            port_types = []
+            for k in netd.keys():
+                for t,ports in netd[k]:
+                    if t not in port_types + ["port_t", "unreserved_port_t"]:
+                        if t.endswith("_type"):
+                            continue
+
+                        port_types.append(t)
+
+            port_types.sort()
+            short_domain = self.strip_domain(self.application)
+            if short_domain[-1] == "d":
+                short_domain = short_domain[:-1]
+            short_domain = short_domain + "_"
+            ctr = 0
+            found = 0
+            for t in port_types:
+                if t.startswith(short_domain):
+                    found = ctr
+                iter = self.network_port_type_combolist.append()
+                self.network_port_type_combolist.set_value(iter, 0, t)
+                ctr += 1
+            self.network_port_type_combobox.set_active(found)
+
+        except AttributeError:
+            pass
+
+        self.network_tcp_button.set_active(True)
+        self.network_mls_entry.set_text("s0")
+
+    def login_seuser_combobox_change(self, combo, *args):
+        seuser = self.combo_get_active_text(combo)
+        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'])
+
+    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'])
+
+    def get_selected_iter(self):
+        iter = None
+        if not self.treeview:
+            return None
+        row = self.treeview.get_selection()
+        if not row:
+            return None
+        treesort, iter = row.get_selected()
+        if iter:
+            iter = treesort.convert_iter_to_child_iter(iter)
+            if iter:
+                iter = self.treefilter.convert_iter_to_child_iter(iter)
+        return iter
+
+    def cursor_changed(self, *args):
+        self.modify_button.set_sensitive(False)
+        iter = self.get_selected_iter()
+        if iter == None:
+            self.modify_button.set_sensitive(False)
+            return
+        if not self.liststore[iter] or not self.liststore[iter][-1]:
+            return
+        self.modify_button.set_sensitive(self.liststore[iter][-1])
+
+    def login_init_dialog(self, *args):
+        self.show_popup(self.login_popup_window)
+        self.login_seuser_combolist.clear()
+        users = sepolicy.get_all_users()
+        users.sort()
+        for u in users:
+            iter = self.login_seuser_combolist.append()
+            self.login_seuser_combolist.set_value(iter, 0, str(u))
+        self.login_name_entry.set_text("")
+        self.login_mls_entry.set_text("")
+
+    def user_init_dialog(self, *args):
+        self.show_popup(self.user_popup_window)
+        self.user_roles_combolist.clear()
+        roles = sepolicy.get_all_roles()
+        roles.sort()
+        for r in roles:
+            iter = self.user_roles_combolist.append()
+            self.user_roles_combolist.set_value(iter, 0, str(r))
+        self.user_name_entry.set_text("")
+        self.user_mls_entry.set_text("")
+
+    def on_disable_ptrace(self, checkbutton):
+        if self.finish_init:
+            update_buffer = "boolean -m -%d deny_ptrace" % checkbutton.get_active()
+            self.wait_mouse()
+            try:
+                self.dbus.semanage(update_buffer)
+            except dbus.exceptions.DBusException, e:
+                self.error(e)
+            self.ready_mouse()
+
+    def on_show_modified_only(self, checkbutton):
+        length = self.liststore.get_n_columns()
+        def dup_row(row):
+            l = []
+            for i in range(0,length):
+                l.append(row[i])
+            return l
+
+        append_list = []
+        if self.opage == BOOLEANS_PAGE:
+            if not checkbutton.get_active():
+                return self.boolean_initialize(self.application)
+
+            for row in self.liststore:
+                if row[2] in self.cust_dict["boolean"]:
+                    append_list.append(dup_row(row))
+
+        if self.opage == FILES_PAGE:
+            ipage = self.inner_notebook_files.get_current_page()
+            if not checkbutton.get_active():
+                if ipage == EXE_PAGE:
+                    return self.executable_files_initialize(self.application)
+                if ipage == WRITABLE_PAGE:
+                    return self.writable_files_initialize(self.application)
+                if ipage == APP_PAGE:
+                    return self.application_files_initialize(self.application)
+            for row in self.liststore:
+                if (row[0],row[2]) in self.cust_dict["fcontext"]:
+                    append_list.append(row)
+
+        if self.opage == NETWORK_PAGE:
+            if not checkbutton.get_active():
+                return self.network_initialize(self.application)
+            for row in self.liststore:
+                if (row[0], row[1]) in self.cust_dict["port"]:
+                    append_list.append(dup_row(row))
+
+        if self.opage == FILE_EQUIV_PAGE:
+            if not checkbutton.get_active() == True:
+                return self.file_equiv_initialize()
+
+            for row in self.liststore:
+                if row[0] in self.cust_dict["fcontext-equiv"]:
+                    append_list.append(dup_row(row))
+
+        if self.opage == USER_PAGE:
+            if not checkbutton.get_active():
+                return self.user_initialize()
+
+            for row in self.liststore:
+                if row[0] in self.cust_dict["user"]:
+                    append_list.append(dup_row(row))
+
+        if self.opage == LOGIN_PAGE:
+            if not checkbutton.get_active() == True:
+                return self.login_initialize()
+
+            for row in self.liststore:
+                if row[0] in self.cust_dict["login"]:
+                    append_list.append(dup_row(row))
+
+        self.liststore.clear()
+        for row in append_list:
+            iter = self.liststore.append()
+            for i in range(0,length):
+                self.liststore.set_value(iter, i, row[i])
+
+    def init_modified_files_liststore(self, tree, app, ipage, operation, path, fclass, ftype):
+        iter = tree.append(None)
+        tree.set_value(iter, 0, path)
+        tree.set_value(iter, 1, ftype)
+        tree.set_value(iter, 2, fclass)
+
+    def restore_to_default(self, *args):
+        print "restore to defualt clicked..."
+
+    def invalid_entry_retry(self, *args):
+        self.closewindow(self.error_check_window)
+        self.files_popup_window.set_sensitive(True)
+        self.network_popup_window.set_sensitive(True)
+
+    def error_check_files(self, insert_txt):
+        if len(insert_txt) == 0 or insert_txt[0] != '/':
+            self.error_check_window.show()
+            self.files_popup_window.set_sensitive(False)
+            self.network_popup_window.set_sensitive(False)
+            self.error_check_label.set_text((_("The entry '%s' is not a valid path.  Paths must begin with a '/'.")) % insert_txt)
+            return True
+        return False
+
+    def error_check_network(self, port):
+        try:
+            pnum = int(port)
+            if pnum < 1 or pnum > 65536:
+                raise ValueError
+        except ValueError:
+            self.error_check_window.show()
+            self.files_popup_window.set_sensitive(False)
+            self.network_popup_window.set_sensitive(False)
+            self.error_check_label.set_text((_("Port number must be between 1 and 65536")))
+            return True
+        return False
+
+    def show_more_types(self, *args):
+        if self.finish_init:
+            if self.combo_get_active_text(self.files_type_combobox) == _('More...'):
+                self.files_popup_window.hide()
+                self.moreTypes_window_files.show()
+
+    def update_to_login(self, *args):
+        self.close_popup()
+        seuser = self.combo_get_active_text(self.login_seuser_combobox)
+        mls_range = self.login_mls_entry.get_text()
+        name = self.login_name_entry.get_text()
+        if self.modify:
+            iter = self.get_selected_iter()
+            oldname = self.login_liststore.get_value(iter,0)
+            oldseuser = self.login_liststore.get_value(iter,1)
+            oldrange = self.login_liststore.get_value(iter,2)
+            self.liststore.set_value(iter,0,oldname)
+            self.liststore.set_value(iter,1,oldseuser)
+            self.liststore.set_value(iter,2,oldrange)
+            self.cur_dict["login"][name] = { "action": "-m", "range": mls_range, "seuser": seuser, "oldrange": oldrange, "oldseuser": oldseuser, "oldname": oldname }
+        else:
+            iter = self.liststore.append(None)
+            self.cur_dict["login"][name] = { "action": "-a", "range": mls_range, "seuser": seuser }
+
+        self.liststore.set_value(iter,0,name)
+        self.liststore.set_value(iter,1,seuser)
+        self.liststore.set_value(iter,2, mls_range)
+
+        self.new_updates()
+
+    def update_to_user(self, *args):
+        self.close_popup()
+        roles = self.combo_get_active_text(self.user_roles_combobox)
+        level = self.user_mls_level_entry.get_text()
+        mls_range = self.user_mls_entry.get_text()
+        name = self.user_name_entry.get_text()
+        if self.modify:
+            iter = self.get_selected_iter()
+            oldname = self.user_liststore.get_value(iter,0)
+            oldroles = self.user_liststore.get_value(iter,1)
+            oldlevel = self.user_liststore.get_value(iter,1)
+            oldrange = self.user_liststore.get_value(iter,3)
+            self.liststore.set_value(iter,0,oldname)
+            self.liststore.set_value(iter,1,oldroles)
+            self.liststore.set_value(iter,2,oldlevel)
+            self.liststore.set_value(iter,3,oldrange)
+            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}
+
+        self.liststore.set_value(iter, 0, name)
+        self.liststore.set_value(iter, 1, roles)
+        self.liststore.set_value(iter, 2, level)
+        self.liststore.set_value(iter, 3, mls_range)
+
+        self.new_updates()
+
+    def update_to_file_equiv(self, *args):
+        self.close_popup()
+        dest = self.file_equiv_dest_entry.get_text()
+        src = self.file_equiv_source_entry.get_text()
+        if self.modify:
+            iter = self.get_selected_iter()
+            olddest = self.unmarkup(self.liststore.set_value(iter,0))
+            oldsrc = self.unmarkup(self.liststore.set_value(iter,1))
+            self.cur_dict["fcontext-equiv"][dest] = { "action": "-m", "src": src, "oldsrc": oldsrc, "olddest": olddest }
+        else:
+            iter = self.liststore.append(None)
+            self.cur_dict["fcontext-equiv"][dest] = { "action": "-a", "src": src }
+        self.liststore.set_value(iter,0,self.markup(dest))
+        self.liststore.set_value(iter,1,self.markup(src))
+
+    def update_to_files(self, *args):
+        self.close_popup()
+        self.files_add = True
+        # Insert Function will be used in the future
+        path = self.files_path_entry.get_text()
+        if self.error_check_files(path):
+            return
+
+        setype = self.combo_get_active_text(self.files_type_combobox)
+        mls = self.files_mls_entry.get_text()
+        tclass = self.combo_get_active_text(self.files_class_combobox)
+
+        if self.modify:
+            iter = self.get_selected_iter()
+            oldpath = self.unmark(self.liststore.get_value(iter, 0))
+            setype = self.unmark(self.liststore.set_value(iter, 1))
+            oldtclass = self.liststore.get_value(iter, 2)
+            self.cur_dict["fcontext"][(path, tclass)] = { "action": "-m", "type": setype, "oldtype": oldsetype, "oldmls": oldmls, "oldclass": oldclass }
+        else:
+            iter = self.liststore.append(None)
+            self.cur_dict["fcontext"][(path, tclass)] = { "action": "-a", "type": setype }
+        self.liststore.set_value(iter, 0, self.markup(path))
+        self.liststore.set_value(iter, 1, self.markup(setype))
+        self.liststore.set_value(iter, 2, self.markup(tclass))
+
+        self.files_add = False
+        self.recursive_path_toggle.set_active(False)
+        self.new_updates()
+
+    def update_to_network(self, *args):
+        self.network_add = True
+        ports = self.network_ports_entry.get_text()
+        if self.error_check_network(ports):
+            return
+        if self.network_tcp_button.get_active():
+            protocol = "tcp"
+        else:
+            protocol = "udp"
+
+        setype = self.combo_get_active_text(self.network_port_type_combobox)
+        mls = self.network_mls_entry.get_text()
+
+        if self.modify:
+            iter = self.get_selected_iter()
+            oldports = self.unmark(self.liststore.get_value(iter, 0))
+            oldprotocol = self.unmark(self.liststore.get_value(iter, 1))
+            oldsetype = self.unmark(self.liststore.set_value(iter, 2))
+            self.cur_dict["port"][(ports, protocol)] = { "action": "-m", "type": setype, "mls": mls, "oldtype": oldsetype, "oldmls": oldmls, "oldprotocol": oldprotocol, "oldports": oldports }
+        else:
+            iter = self.liststore.append(None)
+            self.cur_dict["port"][(ports, protocol)] = { "action": "-a", "type": setype, "mls": mls}
+        self.liststore.set_value(iter, 0, ports)
+        self.liststore.set_value(iter, 1, protocol)
+        self.liststore.set_value(iter, 2, setype)
+
+        self.network_add = False
+        self.network_popup_window.hide()
+        self.window.set_sensitive(True)
+        self.new_updates()
+
+    def delete_button_clicked(self, *args):
+        operation = "Add"
+        self.window.set_sensitive(False)
+        if self.opage == NETWORK_PAGE:
+            self.network_delete_liststore.clear()
+            port_dict = self.cust_dict["port"]
+            for ports,protocol in port_dict:
+                setype = port_dict[(ports, protocol)]["type"]
+                iter = self.network_delete_liststore.append()
+                self.network_delete_liststore.set_value(iter, 1, ports)
+                self.network_delete_liststore.set_value(iter, 2, protocol)
+                self.network_delete_liststore.set_value(iter, 3, setype)
+            self.show_popup(self.network_delete_window)
+            return
+
+        if self.opage == FILES_PAGE:
+            self.files_delete_liststore.clear()
+            fcontext_dict = self.cust_dict["fcontext"]
+            for path,tclass in fcontext_dict:
+                setype = fcontext_dict[(path, tclass)]["type"]
+                iter = self.files_delete_liststore.append()
+                self.files_delete_liststore.set_value(iter, 1, path)
+                self.files_delete_liststore.set_value(iter, 2, setype)
+                self.files_delete_liststore.set_value(iter, 3, sepolicy.file_type_str[tclass])
+            self.show_popup(self.files_delete_window)
+            return
+
+        if self.opage == USER_PAGE:
+            self.user_delete_liststore.clear()
+            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"]
+                iter = self.user_delete_liststore.append()
+                self.user_delete_liststore.set_value(iter, 1, user)
+                self.user_delete_liststore.set_value(iter, 2, roles)
+                self.user_delete_liststore.set_value(iter, 3, level)
+                self.user_delete_liststore.set_value(iter, 4, mls)
+            self.show_popup(self.user_delete_window)
+            return
+
+        if self.opage == LOGIN_PAGE:
+            self.login_delete_liststore.clear()
+            login_dict = self.cust_dict["login"]
+            for login in login_dict:
+                seuser = login_dict[login]["seuser"]
+                mls = login_dict[login]["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)
+                self.login_delete_liststore.set_value(iter, 3, mls)
+            self.show_popup(self.login_delete_window)
+            return
+
+        if self.opage == FILE_EQUIV_PAGE:
+            self.file_equiv_delete_liststore.clear()
+            for items in self.file_equiv_liststore:
+                if items[2]:
+                    iter = self.file_equiv_delete_liststore.append()
+                    self.file_equiv_delete_liststore.set_value(iter, 1, self.unmarkup(items[0]))
+                    self.file_equiv_delete_liststore.set_value(iter, 2, self.unmarkup(items[1]))
+            self.show_popup(self.file_equiv_delete_window)
+            return
+
+    def on_save_delete_clicked(self, *args):
+        self.close_popup()
+        if self.opage == NETWORK_PAGE:
+            for delete in self.network_delete_liststore:
+                if delete[0]:
+                    self.cur_dict["port"][(delete[1], delete[2])] = { "action": "-d", "type": delete[3] }
+        if self.opage == FILES_PAGE:
+            for delete in self.files_delete_liststore:
+                if delete[0]:
+                    self.cur_dict["fcontext"][(delete[1], reverse_file_type_str[delete[3]])] = { "action": "-d", "type": delete[2] }
+        if self.opage == USER_PAGE:
+            for delete in self.user_delete_liststore:
+                if delete[0]:
+                    self.cur_dict["user"][delete[1]] = { "action": "-d" , "role": delete[2], "range": delete[4] }
+        if self.opage == LOGIN_PAGE:
+            for delete in self.login_delete_liststore:
+                if delete[0]:
+                    self.cur_dict["login"][delete[2]] = { "action": "-d", "login":delete[2], "seuser":delete[1], "range":delete[3] }
+        if self.opage == FILE_EQUIV_PAGE:
+            for delete in self.file_equiv_delete_liststore:
+                if delete[0]:
+                    self.cur_dict["fcontext-equiv"][delete[1]] = { "action": "-d", "src" : delete[2] }
+        self.new_updates()
+
+    def on_save_delete_file_equiv_clicked(self, *args):
+        for delete in self.files_delete_liststore:
+            print delete[0], delete[1], delete[2],
+
+    def on_toggle_update(self, cell, path, model):
+        model[path][0] = not model[path][0]
+
+    def ipage_delete(self, liststore, key):
+        ctr = 0
+        for items in liststore:
+            if items[0] == key[0] and items[2] == key[1]:
+                iter = liststore.get_iter(ctr)
+                liststore.remove(iter)
+                return
+            ctr+=1
+
+    def on_toggle(self, cell, path, model):
+        if not path:
+            return
+        iter = self.boolean_filter.get_iter(path)
+        iter = self.boolean_filter.convert_iter_to_child_iter(iter)
+        name = model.get_value(iter, 2)
+        model.set_value(iter, 0, not model.get_value(iter, 0))
+        active = model.get_value(iter, 0)
+        if name in self.cur_dict["boolean"]:
+            del(self.cur_dict["boolean"][name])
+        else:
+            self.cur_dict["boolean"][name] = {"active":active}
+        self.new_updates()
+
+    def get_advanced_filter_data(self, entry, *args):
+        self.filter_txt = entry.get_text()
+        self.advanced_search_filter.refilter()
+
+    def get_filter_data(self, windows, *args):
+        #search for desired item
+        # The txt that the use rinputs into the filter is stored in filter_txt
+        self.filter_txt = windows.get_text()
+        self.treefilter.refilter()
+
+    def update_gui(self, *args):
+        self.update = True
+        self.update_treestore.clear()
+        for bools in self.cur_dict["boolean"]:
+            operation = self.cur_dict["boolean"][bools]["action"]
+            iter = self.update_treestore.append(None)
+            self.update_treestore.set_value(iter, 0, True)
+            self.update_treestore.set_value(iter, 1,  sepolicy.boolean_desc(bools))
+            self.update_treestore.set_value(iter, 2, action[self.cur_dict["boolean"][bools]['active']])
+            self.update_treestore.set_value(iter, 3, True)
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 1, (_("SELinux name: %s"))% bools)
+            self.update_treestore.set_value(niter, 3, False)
+
+        for path,tclass in self.cur_dict["fcontext"]:
+            operation = self.cur_dict["fcontext"][(path,tclass)]["action"]
+            setype = self.cur_dict["fcontext"][(path,tclass)]["type"]
+            iter = self.update_treestore.append(None)
+            self.update_treestore.set_value(iter, 0, True)
+            self.update_treestore.set_value(iter, 2, operation)
+            self.update_treestore.set_value(iter, 0, True)
+            if operation == "-a":
+                self.update_treestore.set_value(iter, 1, (_("Add file labeling for %s"))% self.application)
+            if operation == "-d":
+                self.update_treestore.set_value(iter, 1, (_("Delete file labeling for %s"))% self.application)
+            if operation == "-m":
+                self.update_treestore.set_value(iter, 1, (_("Modify file labeling for %s"))% self.application)
+
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 3, False)
+            self.update_treestore.set_value(niter, 1, (_("File path: %s"))% path)
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 3, False)
+            self.update_treestore.set_value(niter, 1, (_("File class: %s"))% sepolicy.file_type_str[tclass])
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 3, False)
+            self.update_treestore.set_value(niter, 1, (_("SELinux file type: %s"))% setype)
+
+        for port,protocol in self.cur_dict["port"]:
+            operation = self.cur_dict["port"][(port,protocol)]["action"]
+            iter = self.update_treestore.append(None)
+            self.update_treestore.set_value(iter, 0, True)
+            self.update_treestore.set_value(iter, 2, operation)
+            self.update_treestore.set_value(iter, 3, True)
+            if operation == "-a":
+                self.update_treestore.set_value(iter, 1, (_("Add ports for %s"))% self.application)
+            if operation == "-d":
+                self.update_treestore.set_value(iter, 1, (_("Delete ports for %s"))% self.application)
+            if operation == "-m":
+                self.update_treestore.set_value(iter, 1, (_("Modify ports for %s"))% self.application)
+
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 1, (_("Network ports: %s"))% port)
+            self.update_treestore.set_value(niter, 3, False)
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 1, (_("Network protocol: %s"))% protocol)
+            self.update_treestore.set_value(niter, 3, False)
+            setype = self.cur_dict["port"][(port, protocol)]["type"]
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 3, False)
+            self.update_treestore.set_value(niter, 1, (_("SELinux file type: %s"))% setype)
+
+        for user in self.cur_dict["user"]:
+            operation = self.cur_dict["user"][user]["action"]
+            iter = self.update_treestore.append(None)
+            self.update_treestore.set_value(iter, 0, True)
+            self.update_treestore.set_value(iter, 2, operation)
+            self.update_treestore.set_value(iter, 0, True)
+            if operation == "-a":
+                self.update_treestore.set_value(iter, 1, _("Add user"))
+            if operation == "-d":
+                self.update_treestore.set_value(iter, 1, _("Delete user"))
+            if operation == "-m":
+                self.update_treestore.set_value(iter, 1, _("Modify user"))
+
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 1, (_("SELinux User : %s"))% user)
+            self.update_treestore.set_value(niter, 3, False)
+            niter = self.update_treestore.append(iter)
+            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"]
+            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)
+
+        for login in self.cur_dict["login"]:
+            operation = self.cur_dict["login"][login]["action"]
+            iter = self.update_treestore.append(None)
+            self.update_treestore.set_value(iter, 0, True)
+            self.update_treestore.set_value(iter, 2, operation)
+            self.update_treestore.set_value(iter, 0, True)
+            if operation == "-a":
+                self.update_treestore.set_value(iter, 1, _("Add login mapping"))
+            if operation == "-d":
+                self.update_treestore.set_value(iter, 1, _("Delete login mapping"))
+            if operation == "-m":
+                self.update_treestore.set_value(iter, 1, _("Modify login mapping"))
+
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 3, False)
+            self.update_treestore.set_value(niter, 1, (_("Login Name : %s"))% login)
+            niter = self.update_treestore.append(iter)
+            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"]
+            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)
+
+        for path in self.cur_dict["fcontext-equiv"]:
+            operation = self.cur_dict["fcontext-equiv"][path]["action"]
+            iter = self.update_treestore.append(None)
+            self.update_treestore.set_value(iter, 0, True)
+            self.update_treestore.set_value(iter, 2, operation)
+            self.update_treestore.set_value(iter, 0, True)
+            if operation == "-a":
+                self.update_treestore.set_value(iter, 1, (_("Add file equiv labeling.")))
+            if operation == "-d":
+                self.update_treestore.set_value(iter, 1, (_("Delete file equiv labeling.")))
+            if operation == "-m":
+                self.update_treestore.set_value(iter, 1, (_("Modify file equiv labeling.")))
+
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 3, False)
+            self.update_treestore.set_value(niter, 1, (_("File path : %s"))% path)
+            niter = self.update_treestore.append(iter)
+            self.update_treestore.set_value(niter, 3, False)
+            src = self.cur_dict["fcontext-equiv"][path]["src"]
+            self.update_treestore.set_value(niter, 1, (_("Equivalence: %s")) % src)
+
+        self.show_popup(self.update_window)
+
+    def set_active_application_button(self):
+        if self.boolean_radio_button.get_active():
+            self.active_button = self.boolean_radio_button
+        if self.files_radio_button.get_active():
+            self.active_button = self.files_radio_button
+        if self.transitions_radio_button.get_active():
+            self.active_button = self.transitions_radio_button
+        if self.network_radio_button.get_active():
+            self.active_button = self.network_radio_button
+
+    def clearbuttons(self, clear=True):
+        self.main_selection_window.hide()
+        self.boolean_radio_button.set_visible(False)
+        self.files_radio_button.set_visible(False)
+        self.network_radio_button.set_visible(False)
+        self.transitions_radio_button.set_visible(False)
+        self.system_radio_button.set_visible(False)
+        self.lockdown_radio_button.set_visible(False)
+        self.user_radio_button.set_visible(False)
+        self.login_radio_button.set_visible(False)
+        if clear:
+            self.completion_entry.set_text("")
+
+    def show_system_page(self):
+        self.clearbuttons()
+        self.system_radio_button.set_visible(True)
+        self.lockdown_radio_button.set_visible(True)
+        self.applications_selection_button.set_label(_("System"))
+        self.system_radio_button.set_active(True)
+        self.tab_change()
+        self.idle_func()
+
+    def show_file_equiv_page(self, *args):
+        self.clearbuttons()
+        self.file_equiv_initialize()
+        self.file_equiv_radio_button.set_active(True)
+        self.applications_selection_button.set_label(_("File Equivalence"))
+        self.tab_change()
+        self.idle_func()
+        self.add_button.set_sensitive(True)
+        self.delete_button.set_sensitive(True)
+
+    def show_users_page(self):
+        self.clearbuttons()
+        self.login_radio_button.set_visible(True)
+        self.user_radio_button.set_visible(True)
+        self.applications_selection_button.set_label(_("Users"))
+        self.login_radio_button.set_active(True)
+        self.tab_change()
+        self.user_initialize()
+        self.login_initialize()
+        self.idle_func()
+        self.add_button.set_sensitive(True)
+        self.delete_button.set_sensitive(True)
+
+    def show_applications_page(self):
+        self.clearbuttons(False)
+        self.boolean_radio_button.set_visible(True)
+        self.files_radio_button.set_visible(True)
+        self.network_radio_button.set_visible(True)
+        self.transitions_radio_button.set_visible(True)
+        self.boolean_radio_button.set_active(True)
+        self.tab_change()
+        self.idle_func()
+
+    def system_interface(self, *args):
+        self.show_system_page()
+
+    def users_interface(self, *args):
+        self.show_users_page()
+
+    def show_mislabeled_files(self, checkbutton, *args):
+        iterlist = []
+        ctr = 0
+        ipage = self.inner_notebook_files.get_current_page()
+        if checkbutton.get_active() == True:
+            for items in self.liststore:
+                iter = self.treesort.get_iter(ctr)
+                iter = self.treesort.convert_iter_to_child_iter(iter)
+                iter = self.treefilter.convert_iter_to_child_iter(iter)
+                if iter != None:
+                    if self.liststore.get_value(iter, 4) == False:
+                        iterlist.append(iter)
+                    ctr +=1
+            for iters in iterlist:
+                self.liststore.remove(iters)
+
+        elif self.application != None:
+            self.liststore.clear()
+            if ipage == EXE_PAGE:
+                self.executable_files_initialize(self.application)
+            elif ipage == WRITABLE_PAGE:
+                self.writable_files_initialize(self.application)
+            elif ipage == APP_PAGE:
+                self.application_files_initialize(self.application)
+
+    def fix_mislabeled(self, path):
+        cur = selinux.getfilecon(path)[1].split(":")[2]
+        con = selinux.matchpathcon(path,0)[1].split(":")[2]
+        if self.verify(_("Run restorecon on %(PATH)s to change its type from %(CUR_CONTEXT)s to the default %(DEF_CONTEXT)s?") % {"PATH":path, "CUR_CONTEXT": cur, "DEF_CONTEXT": con}, title="restorecon dialog") == Gtk.ResponseType.YES:
+            self.dbus.restorecon(path)
+            self.application_selected()
+
+    def new_updates(self, *args):
+        self.update_button.set_sensitive(self.modified())
+        self.revert_button.set_sensitive(self.modified())
+
+    def update_or_revert_changes(self, button, *args):
+        self.update_gui()
+        self.update = (button.get_label() == _("Update"))
+        if self.update:
+            self.update_window.set_title(_("Update Changes"))
+        else:
+            self.update_window.set_title(_("Revert Changes"))
+
+    def apply_changes_button_press(self, *args):
+        self.close_popup()
+        if self.update:
+            self.update_the_system()
+        else:
+            self.revert_data()
+        self.finish_init = False
+        self.previously_modified_initialize(self.dbus.customized())
+        self.finish_init = True
+        self.clear_filters()
+        self.application_selected()
+        self.new_updates()
+        self.update_treestore.clear()
+
+    def update_the_system(self, *args):
+        self.close_popup()
+        update_buffer = self.format_update()
+        self.wait_mouse()
+        try:
+            self.dbus.semanage(update_buffer)
+        except dbus.exceptions.DBusException, e:
+            print e
+        self.ready_mouse()
+        self.init_cur()
+
+    def ipage_value_lookup(self, lookup):
+        ipage_values = {"Executable Files": 0, "Writable Files": 1, "Application File Type": 2, "Inbound": 1, "Outbound": 0}
+        for value in ipage_values:
+            if value == lookup:
+                return ipage_values[value]
+        return "Booleans"
+
+    def get_attributes_update(self, attribute):
+        attribute = attribute.split(": ")[1]
+        bool_id = attribute.split(": ")[0]
+        if bool_id == "SELinux name":
+            self.bool_revert = attribute
+        else:
+            return attribute
+
+    def format_update(self):
+        self.revert_data()
+        update_buffer = ""
+        for k in self.cur_dict:
+            if k in "boolean":
+                for b in self.cur_dict[k]:
+                    update_buffer += "boolean -m -%d %s\n" % (self.cur_dict[k][b]["active"], b)
+            if k in "login":
+                for l in self.cur_dict[k]:
+                    if self.cur_dict[k][l]["action"] == "-d":
+                        update_buffer += "login -d %s\n" % l
+                    else:
+                        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)
+            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:
+                        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)
+
+            if k in "fcontext-equiv":
+                for f in self.cur_dict[k]:
+                    if self.cur_dict[k][f]["action"] == "-d":
+                        update_buffer += "fcontext -d %s\n" % f
+                    else:
+                        update_buffer += "fcontext %s -e %s %s\n" % (self.cur_dict[k][f]["action"], self.cur_dict[k][f]["src"], f)
+
+            if k in "fcontext":
+                for f in self.cur_dict[k]:
+                    if self.cur_dict[k][f]["action"] == "-d":
+                        update_buffer += "fcontext -d %s\n" % f
+                    else:
+                        update_buffer += "fcontext %s -t %s -f %s %s\n" % (self.cur_dict[k][f]["action"], self.cur_dict[k][f]["type"], self.cur_dict[k][f]["class"], f)
+
+            if k in "port":
+                for port, protocol in self.cur_dict[k]:
+                    if self.cur_dict[k][(port, protocol)]["action"] == "-d":
+                        update_buffer += "port -d -p %s %s\n" % (protocol, port)
+                    else:
+                        update_buffer += "port %s -t %s -p %s %s\n" % (self.cur_dict[k][f]["action"], self.cur_dict[k][f]["type"], procotol, port)
+
+        return update_buffer
+
+    def revert_data(self):
+        ctr = 0
+        remove_list=[]
+        update_buffer =  ""
+        for items in self.update_treestore:
+            if not self.update_treestore[ctr][0]:
+                remove_list.append(ctr)
+            ctr += 1
+        remove_list.reverse()
+        for ctr in remove_list:
+            self.remove_cur(ctr)
+
+    def reveal_advanced_system(self, label, *args):
+        advanced = label.get_text() == ADVANCED_LABEL[0]
+        if advanced:
+            label.set_text(ADVANCED_LABEL[1])
+        else:
+            label.set_text(ADVANCED_LABEL[0])
+        self.system_policy_label.set_visible(advanced)
+        self.system_policy_type_combobox.set_visible(advanced)
+
+    def reveal_advanced(self, label, *args):
+        advanced = label.get_text() == ADVANCED_LABEL[0]
+        if advanced:
+            label.set_text(ADVANCED_LABEL[1])
+        else:
+            label.set_text(ADVANCED_LABEL[0])
+        self.files_mls_label.set_visible(advanced)
+        self.files_mls_entry.set_visible(advanced)
+        self.network_mls_label.set_visible(advanced)
+        self.network_mls_entry.set_visible(advanced)
+
+    def advanced_search_initialize(self, path):
+        try:
+            if path[0] == '/':
+                domain = sepolicy.get_init_transtype(path)
+            else:
+                domain = path
+        except IndexError:
+            return
+        except OSError:
+            return
+        iter = self.advanced_search_liststore.append()
+        self.advanced_search_liststore.set_value(iter, 0, path)
+        self.advanced_search_liststore.set_value(iter, 1, domain)
+        user_types = sepolicy.get_user_types()
+        if domain in user_types + ['initrc_t']:
+            return
+
+        entrypoints = sepolicy.get_entrypoints(domain)
+        # From entry_point = 0 to the number of keys in the dic
+        for exe in entrypoints:
+            if len(entrypoints[exe]):
+                file_class  = entrypoints[exe][1]
+                for path in entrypoints[exe][0]:
+                    iter = self.advanced_search_liststore.append()
+                    self.advanced_search_liststore.set_value(iter, 1, domain)
+                    self.advanced_search_liststore.set_value(iter, 0, path)
+
+    def advanced_label_main(self, label, *args):
+        if label.get_text() == ADVANCED_SEARCH_LABEL[1]:
+            label.set_text(ADVANCED_SEARCH_LABEL[0])
+            self.close_popup()
+        else:
+            label.set_text(ADVANCED_SEARCH_LABEL[1])
+            self.show_popup(self.advanced_search_window)
+
+    def advanced_radio_select(self, button):
+        label = ""
+        if button.get_active():
+            label = button.get_label()
+        if label == '':
+            return
+        self.advanced_search_liststore.clear()
+        if label == "All":
+            for items in self.all_list:
+                self.advanced_search_initialize(items)
+                self.idle_func()
+
+        elif label == "Installed":
+            if self.installed_list == []:
+                return
+            for items in self.installed_list:
+                self.advanced_search_initialize(items)
+                self.idle_func()
+
+    def set_enforce_text(self, value):
+        if value:
+           self.status_bar.push(self.context_id, _("System Status: Enforcing"))
+        else:
+            self.status_bar.push(self.context_id, _("System Status: Permissive"))
+        self.current_status_permissive.set_active(True)
+
+    def set_enforce(self, button):
+        self.dbus.setenforce(button.get_active())
+        self.set_enforce_text(button.get_active())
+
+    def on_browse_select(self, *args):
+        filename = self.file_dialog.get_filename()
+        if filename == None:
+            return
+        self.clear_entry = False
+        self.file_dialog.hide()
+        self.files_path_entry.set_text(filename)
+        if self.import_export == 'Import':
+            self.import_config(filename)
+        elif self.import_export == 'Export':
+            self.export_config(filename)
+
+    def recursive_path(self, *args):
+        path = self.files_path_entry.get_text()
+        if self.recursive_path_toggle.get_active():
+            if not path.endswith("(/.*)?"):
+                self.files_path_entry.set_text(path+"(/.*)?")
+        elif path.endswith("(/.*)?"):
+            path = path.split("(/.*)?")[0]
+            self.files_path_entry.set_text(path)
+
+    def highlight_entry_text(self, entry_obj, *args):
+        txt = entry_obj.get_text()
+        if self.clear_entry:
+            entry_obj.set_text('')
+            self.clear_entry = False
+
+    def autofill_add_files_entry(self, entry):
+        text = entry.get_text()
+        if text == '':
+            return
+        if text.endswith("(/.*)?"):
+            self.recursive_path_toggle.set_active(True)
+        for d in sepolicy.DEFAULT_DIRS:
+            if text.startswith(d):
+                for t in self.files_type_combolist:
+                    if t[0].endswith(sepolicy.DEFAULT_DIRS[d]):
+                        self.combo_set_active_text(self.files_type_combobox, t[0])
+
+    def resize_columns(self, *args):
+        self.boolean_column_1 = self.boolean_treeview.get_col(1)
+        width = self.boolean_column_1.get_width()
+        renderer = self.boolean_column_1.get_cell_renderers()
+
+    def browse_for_files(self, *args):
+        self.file_dialog.show()
+
+    def close_config_window(self, *args):
+        self.file_dialog.hide()
+
+    def change_default_policy(self, *args):
+        if self.typeHistory == self.system_policy_type_combobox.get_active():
+            return
+
+        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:
+            self.system_policy_type_combobox.set_active(self.typeHistory)
+            return None
+
+        self.dbus.change_default_policy(self.combo_get_active_text(self.system_policy_type_combobox))
+        self.dbus.relabel_on_boot(True)
+        self.typeHistory = self.system_policy_type_combobox.get_active()
+
+    def change_default_mode(self, button):
+        if not self.finish_init:
+            return
+        self.enabled_changed(button)
+        if button.get_active():
+            self.dbus.change_default_mode(button.get_label().lower())
+
+    def import_config_show(self, *args):
+        self.file_dialog.set_action(Gtk.FileChooserAction.OPEN)
+        self.file_dialog.set_title("Import Configuration")
+        self.file_dialog.show()
+        #self.file_dialog.set_uri('/tmp')
+        self.import_export = 'Import'
+
+    def export_config_show(self, *args):
+        self.file_dialog.set_action(Gtk.FileChooserAction.SAVE)
+        self.file_dialog.set_title("Export Configuration")
+        self.file_dialog.show()
+        self.import_export = 'Export'
+
+    def export_config(self, filename):
+        self.wait_mouse()
+        buf = self.dbus.customized()
+        fd = open(filename, 'w')
+        fd.write(buf)
+        fd.close()
+        self.ready_mouse()
+
+    def import_config(self, filename):
+        fd = open(filename, "r")
+        buf = fd.read()
+        fd.close()
+        self.wait_mouse()
+        try:
+            self.dbus.semanage(buf)
+        except OSError:
+            pass
+        self.ready_mouse()
+
+    def init_dictionary(self, dic, app, ipage, operation, p, q, ftype, mls, changed, old):
+        if (app, ipage, operation) not in dic:
+                    dic[app, ipage, operation] = {}
+        if (p, q) not in dic[app, ipage, operation]:
+                    dic[app, ipage, operation][p, q] = {'type': ftype, 'mls': mls, 'changed': changed, 'old': old}
+
+    def translate_bool(self, b):
+        b = b.split('-')[1]
+        if b == '0':
+            return False
+        if b == '1':
+            return True
+
+    def relabel_on_reboot(self, *args):
+        active = self.relabel_button.get_active()
+        exists = os.path.exists("/.autorelabel")
+
+        if active and exists:
+            return
+        if not active and not exists:
+            return
+        try:
+            self.dbus.relabel_on_boots(active)
+        except dbus.exceptions.DBusException, e:
+            self.error(e)
+
+    def closewindow(self, window, *args):
+        window.hide()
+        self.recursive_path_toggle.set_active(False)
+        self.window.set_sensitive(True)
+        if self.moreTypes_window_files == window:
+            self.show_popup(self.files_popup_window)
+            if self.combo_get_active_text(self.files_type_combobox) == _('More...'):
+                self.files_type_combobox.set_active(0)
+        if self.error_check_window == window:
+            if self.files_add:
+                self.show_popup(self.files_popup_window)
+            elif self.network_add:
+                self.show_popup(self.network_popup_window)
+        if self.files_mls_label.get_visible() or self.network_mls_label.get_visible():
+            self.advanced_text_files.set_visible(True)
+            self.files_mls_label.set_visible(False)
+            self.files_mls_entry.set_visible(False)
+            self.advanced_text_network.set_visible(True)
+            self.network_mls_label.set_visible(False)
+            self.network_mls_entry.set_visible(False)
+        if self.main_advanced_label.get_text() == ADVANCED_SEARCH_LABEL[1]:
+            self.main_advanced_label.set_text(ADVANCED_SEARCH_LABEL[0])
+        return True
+
+    def wait_mouse(self):
+        self.window.get_window().set_cursor(self.busy_cursor)
+        self.idle_func()
+
+    def ready_mouse(self):
+        self.window.get_window().set_cursor(self.ready_cursor)
+        self.idle_func()
+
+    def verify(self, message, title="" ):
+        dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO,
+                                Gtk.ButtonsType.YES_NO,
+                                message)
+        dlg.set_title(title)
+        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.MessageType.ERROR,
+                                Gtk.ButtonsType.CLOSE,
+                                message)
+        dlg.set_position(Gtk.WindowPosition.MOUSE)
+        dlg.show_all()
+        dlg.run()
+        dlg.destroy()
+
+    def enabled_changed(self, radio):
+        if not radio.get_active():
+            return
+        label = radio.get_label()
+        if label == 'Disabled' and self.enforce_mode != 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.ResponseType.NO:
+                self.enforce_button.set_active(True)
+
+        if label != 'Disabled' and self.enforce_mode == DISABLED:
+            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:
+                self.enforce_button.set_active(True)
+        self.enforce_button = radio
+
+    def clear_filters(self, *args):
+        self.filter_entry.set_text('')
+        self.show_modified_only.set_active(False)
+
+    def unconfined_toggle(self, *args):
+        if not self.finish_init:
+            return
+        self.wait_mouse()
+        if self.enable_unconfined_button.get_active():
+            self.dbus.semanage("module -e unconfined")
+        else:
+            self.dbus.semanage("module -d unconfined")
+        self.ready_mouse()
+
+    def permissive_toggle(self, *args):
+        if not self.finish_init:
+            return
+        self.wait_mouse()
+        if self.enable_permissive_button.get_active():
+            self.dbus.semanage("module -e permissivedomains")
+        else:
+            self.dbus.semanage("module -d permissivedomains")
+        self.ready_mouse()
+
+    def confirmation_close(self, button, *args):
+        if len(self.update_treestore) > 0:
+            if self.verify(_("You are attempting to close the application without applying your changes.\n    *    To apply changes you have made during this session, click No and click Update.\n    *    To leave the application without applying your changes, click Yes.  All changes that you have made during this session will be lost."), _("Loss of data Dialog")) == Gtk.ResponseType.NO:
+                return True
+        self.quit()
+
+    def quit(self, *args):
+        sys.exit(0)
+
+if __name__ == '__main__':
+    start = SELinuxGui()
diff --git a/policycoreutils/sepolicy/sepolicy/help/__init__.py b/policycoreutils/sepolicy/sepolicy/help/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans.png b/policycoreutils/sepolicy/sepolicy/help/booleans.png
new file mode 100644
index 0000000000000000000000000000000000000000..a7b420667c894dbf13150de13c22e5de2df18d84
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans.txt b/policycoreutils/sepolicy/sepolicy/help/booleans.txt
new file mode 100644
index 0000000..69dc3c4
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/booleans.txt
@@ -0,0 +1,7 @@
+You are viewing the booleans page for the application domain.  
+
+
+SELinux Policy writers have written booleans, if-than-else rules, into the policy. This allows the administrator to change the way SELinux enforces policy on an application. The administrator can tighten or loosen the SELinux policy based on his needs.
+
+You can use the 'Filter Text Entry' to search for appropriate booleans.  The Show Modified Only toggle, will show the booleans that your system has customized.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans_more.png b/policycoreutils/sepolicy/sepolicy/help/booleans_more.png
new file mode 100644
index 0000000000000000000000000000000000000000..1323d1aaa824f0c3479ba7dec3b86865e6ae37ab
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans_more.txt b/policycoreutils/sepolicy/sepolicy/help/booleans_more.txt
new file mode 100644
index 0000000..07d0061
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/booleans_more.txt
@@ -0,0 +1,5 @@
+You are viewing the booleans page for the application domain.  
+
+
+Selecting the 'More...' button will open a dialog containing the SELinux allow rules that are turned on by the selected boolean.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans_more_show.png b/policycoreutils/sepolicy/sepolicy/help/booleans_more_show.png
new file mode 100644
index 0000000000000000000000000000000000000000..885704bd005ae1531f0669107ce26c7a42774e62
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans_more_show.txt b/policycoreutils/sepolicy/sepolicy/help/booleans_more_show.txt
new file mode 100644
index 0000000..f8a8715
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/booleans_more_show.txt
@@ -0,0 +1,4 @@
+You are viewing the booleans page for the application domain.
+
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans_toggled.png b/policycoreutils/sepolicy/sepolicy/help/booleans_toggled.png
new file mode 100644
index 0000000000000000000000000000000000000000..7a36510a1b28e445d9ae94a989201a58763140fc
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/booleans_toggled.txt b/policycoreutils/sepolicy/sepolicy/help/booleans_toggled.txt
new file mode 100644
index 0000000..15472d4
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/booleans_toggled.txt
@@ -0,0 +1,5 @@
+You are viewing the booleans page for the application domain.  
+
+
+Toggle the button to turn on or off the boolean.  This will not happen immediately. All changes on the application screen are bundled up into a single transaction.  You need to select the update button to apply all of your changes to the system.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/file_equiv.png b/policycoreutils/sepolicy/sepolicy/help/file_equiv.png
new file mode 100644
index 0000000000000000000000000000000000000000..0f46ac03fe190377191470f2712c0e74dc660c2b
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/file_equiv.txt b/policycoreutils/sepolicy/sepolicy/help/file_equiv.txt
new file mode 100644
index 0000000..4f264cb
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/file_equiv.txt
@@ -0,0 +1,21 @@
+SELinux can either setup labeling directory using the Application/files screen, or you can setup file equivalence.
+
+
+File Equivalence allows an administrator to label entire directory trees as the same way as the Equivalence directory tree.
+
+Use Case 1:
+An administrator want to store his Apache root content in a location other then /var/www like /srv/www. He could define an equivalence between /srv/www and /var/www.
+
+libselinux reads the equivalence rules and does the substitution when ever the matchpathcon function is called.  Tools like restorecon/rpm/udev and others will all follow the substitution.  Using the example above when matchpathcon is handed /srv/www/cgi-bin/myscript.cgi, it substitutes /var/www for /svr/www and looks up the context of /var/www/cgi-bin/myscript.cgi.
+
+In the command line you could execute.
+
+# semanage fcontext -a -e /var/www /srv/www
+
+Another common case where you might want to use file equivalence, is if you put your users home directories in a location other then /home.  
+
+If you setup an equivalence between /home and /export/home
+
+# matchpathcon /export/home/dwalsh/.ssh
+/export/home/dwalsh/.ssh    unconfined_u:object_r:home_ssh_t:s0
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/files_apps.png b/policycoreutils/sepolicy/sepolicy/help/files_apps.png
new file mode 100644
index 0000000000000000000000000000000000000000..04dddf2d422eca512a3028dc98f4bf429d473505
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/files_apps.txt b/policycoreutils/sepolicy/sepolicy/help/files_apps.txt
new file mode 100644
index 0000000..b1d3b56
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/files_apps.txt
@@ -0,0 +1,10 @@
+This screen shows application types that are defined for process running with the '%(APP)s' type.
+
+
+The description should give you a decent description for what the application is allowed to do with the type.   If your application type is being denied access to a particular file, you might want to change the label of that file.
+
+It is recommended that you use one of the types defined on this page.  
+
+Note if the label of the content that is being denied is owned by another domain, you might have to write policy or use 'audit2allow -M mypol' to allow access.
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/files_exec.png b/policycoreutils/sepolicy/sepolicy/help/files_exec.png
new file mode 100644
index 0000000000000000000000000000000000000000..3de19cc56041ac9a9b95b710fbadf95f02798ac2
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/files_exec.txt b/policycoreutils/sepolicy/sepolicy/help/files_exec.txt
new file mode 100644
index 0000000..7193822
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/files_exec.txt
@@ -0,0 +1,5 @@
+This screen shows application types that can transition to a process running with the '%(APP)s' type.
+
+
+In SELinux these are called entrypoints.  SELinux controls the executable files that can be used as an entrypoint to an confined domain.  If you have an alternate executable that you would like to run in the '%(APP)s' domain, you need to change the executable file type to the entrypoint type.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/files_write.png b/policycoreutils/sepolicy/sepolicy/help/files_write.png
new file mode 100644
index 0000000000000000000000000000000000000000..908fd81b05c08d964a31904aa6c06191816c8777
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/files_write.txt b/policycoreutils/sepolicy/sepolicy/help/files_write.txt
new file mode 100644
index 0000000..a7553ae
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/files_write.txt
@@ -0,0 +1,11 @@
+This screen shows files types to which a process running with the '%(APP)s' type is allowed to write.
+
+
+The description should give you a decent description for what the application is allowed to do with the type.   If your application type is being denied access to a particular file, you might want to change the label of that file.
+
+It is recommended that you use one of the types defined on this page.  
+
+Note if the label of the content that is being denied is owned by another domain, you might have to write policy or use 'audit2allow -M mypol'
+to allow access.
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown.png b/policycoreutils/sepolicy/sepolicy/help/lockdown.png
new file mode 100644
index 0000000000000000000000000000000000000000..f6225503249b3974d5c1c2bbaf51ef28e319b595
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown.txt b/policycoreutils/sepolicy/sepolicy/help/lockdown.txt
new file mode 100644
index 0000000..3463066
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/lockdown.txt
@@ -0,0 +1,5 @@
+The Lockdown Screen allows you to tighten the SELinux Security on your machine.  
+
+
+These lockdown measures are recommended, but can cause SELinux issues.  If you have a machine you truly want to secure, and are confident in your understanding of SELinux you should try some of these options.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown_permissive.png b/policycoreutils/sepolicy/sepolicy/help/lockdown_permissive.png
new file mode 100644
index 0000000000000000000000000000000000000000..f0f082cce66dc59c4f55aec36dfe4ccea595229f
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown_permissive.txt b/policycoreutils/sepolicy/sepolicy/help/lockdown_permissive.txt
new file mode 100644
index 0000000..75548e9
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/lockdown_permissive.txt
@@ -0,0 +1,11 @@
+Disable Permissive Processes
+
+
+Disabling the 'permissivedomains' module allows you to remove all permissive domains shipped with the distribution.
+
+When the distribution policy writers write a new confined domain, they initially ship the policy for that domain in permissive mode.  Permissive mode means that a process running in the domain will not be confined by SELinux.  The kernel will log the AVC messages, access denials, that would have happened had the process been run in enforcing mode.
+
+Permissive domain policies are experimental and will be turned to enforcing in future Operation System Releases.
+
+Note if you disable the permissive domains module, you may see an increase in the denials in your log files.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown_ptrace.png b/policycoreutils/sepolicy/sepolicy/help/lockdown_ptrace.png
new file mode 100644
index 0000000000000000000000000000000000000000..188a9cd0fa5e42048fa131f74cdeab41973689d9
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown_ptrace.txt b/policycoreutils/sepolicy/sepolicy/help/lockdown_ptrace.txt
new file mode 100644
index 0000000..c0c2082
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/lockdown_ptrace.txt
@@ -0,0 +1,15 @@
+Disable ptrace capability on your system.
+
+
+The deny_ptrace feature allows an administrator to toggle the ability of processes on the computer system from examining other processes on the system, including user processes.   It can even block processes running as root.
+
+Most people do not realize that any program they run can examine the memory of any other process run by them.  Meaning the computer game you are running on your desktop can watch everything going on in Firefox or a programs like pwsafe or kinit or other program that attempts to hide passwords..
+
+SELinux defines this access as ptrace and sys_ptrace.  These accesses allow one process to read the memory of another process.   ptrace allows developers and administrators to debug how a process is running using tools like strace, ptrace and gdb.    You can even use gdb (GNU Debugger to manipulate another process running memory and environment. 
+
+The problem is this is allowed by default. 
+
+My wife does not debug programs, why is she allowed to debug them?  As a matter of fact most of the time, I am not debugging applications, so it would be more secure if we could disable it by default.
+
+Note: Disabling ptrace can break some bug trappers that attempt to collect crash data.  
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown_unconfined.png b/policycoreutils/sepolicy/sepolicy/help/lockdown_unconfined.png
new file mode 100644
index 0000000000000000000000000000000000000000..76ba89da2efa7402b471df6ec03c31a8c8e813cc
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/lockdown_unconfined.txt b/policycoreutils/sepolicy/sepolicy/help/lockdown_unconfined.txt
new file mode 100644
index 0000000..422e8e4
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/lockdown_unconfined.txt
@@ -0,0 +1,11 @@
+Disable Unconfined System Processes
+
+
+By default any system process that is started at boot that do not have SELinux Policy defined for them, run as initrc_t or init_t.  These domains are unconfined by SELinux.  Other similar processes which do not have SELinux Policy written for them run also unconfined.  By disabling the unconfined module moves you closer to what used to be called strict policy, and locks down your machine tighter.
+
+Disabling the unconfined module will leave certain unconfined domains running on your system, specifically the unconfined_t user.  If you do not
+want unconfined_t users on your system you would need to remove them from the 'Login Mapping' and Users Screens.
+
+Note if you disable the unconfined module, you may see an increase in the denials, and if you have processes running as initrc_t, you may need to write policy for them.
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/login.png b/policycoreutils/sepolicy/sepolicy/help/login.png
new file mode 100644
index 0000000000000000000000000000000000000000..5ea8603d51f7c6154da821ffcf3098a7e3b95c8b
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/login.txt b/policycoreutils/sepolicy/sepolicy/help/login.txt
new file mode 100644
index 0000000..2af351b
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/login.txt
@@ -0,0 +1,23 @@
+By Default on a SELinux Targeted Policy system, all users login using the unconfined_t user.  
+
+
+But SELinux has a very powerful concept called confined users.  You can setup individual users on your system to login with different SELinux user types.  This Login Mapping Screen allows you to map a Linux login user to an SELinux User.
+
+Default SELinux Users:
+
+* Terminal user/ssh - guest_u
+  - No Network, No setuid, no exec in homedir
+
+* Browser user/kiosk - xguest_u
+  - Web access ports only.  No setuid, no exec in homedir
+
+* Full Desktop user - User_u
+  - Full Network, No SETUID.
+
+* Confined Admin/Desktop User - Staff_u 
+  - Full Network, sudo to admin only, no root password.  Usually a confined admin
+
+* Unconfined user - unconfined_u (Default)
+  - SELinux does not block access.
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/login_default.png b/policycoreutils/sepolicy/sepolicy/help/login_default.png
new file mode 100644
index 0000000000000000000000000000000000000000..0da80aeb4156b05fd66d71831522aee7e7e703b5
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/login_default.txt b/policycoreutils/sepolicy/sepolicy/help/login_default.txt
new file mode 100644
index 0000000..8fcbfc2
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/login_default.txt
@@ -0,0 +1,10 @@
+The Login Mapping Screen has a special Login user called __default__.  This record is used to setup the default login user for any login account that is not specified separately.
+
+
+If this is a desktop system you might want to specify the user_u or xguest_u user.  If this is a terminal server the guest_u user might be a good match.
+
+Then you would need to add the admin users or a Linux group with a different label. Perhaps as unconfined_u or staff_u.
+
+You could use %%wheel to indicate the wheel group.
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/ports_inbound.png b/policycoreutils/sepolicy/sepolicy/help/ports_inbound.png
new file mode 100644
index 0000000000000000000000000000000000000000..af2dd9f27214976039b1780c3f07370af1889bc8
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/ports_inbound.txt b/policycoreutils/sepolicy/sepolicy/help/ports_inbound.txt
new file mode 100644
index 0000000..d8d11d2
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/ports_inbound.txt
@@ -0,0 +1,8 @@
+This screen shows the network ports that processes running with the '%(APP)s' type is allowed to bind to.
+
+
+SELinux controls the network ports that a application is allowed to bind to based on SELinux Port types.
+
+This screen allows you to modify the port number/port type definitions, which the '(APP)s' is currently allowed to bind.  
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/ports_outbound.png b/policycoreutils/sepolicy/sepolicy/help/ports_outbound.png
new file mode 100644
index 0000000000000000000000000000000000000000..da8633bf1c642f1904db55f801e6a8f04a44ed4e
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/ports_outbound.txt b/policycoreutils/sepolicy/sepolicy/help/ports_outbound.txt
new file mode 100644
index 0000000..710bb70
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/ports_outbound.txt
@@ -0,0 +1,8 @@
+This screen shows the network ports to which processes running with the '%(APP)s' type is allowed to connect.
+
+
+SELinux controls the network ports that a applications are allowed to connect, based on SELinux Port types.  
+
+This screen allows you to modify the port number/port type definitions, which the '%(APP)s' is currently allowed to connect.  
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/start.png b/policycoreutils/sepolicy/sepolicy/help/start.png
new file mode 100644
index 0000000000000000000000000000000000000000..8ef461b0f84915d912a891532e1a2ea85a32678f
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/start.txt b/policycoreutils/sepolicy/sepolicy/help/start.txt
new file mode 100644
index 0000000..58ccf03
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/start.txt
@@ -0,0 +1,7 @@
+You must 'Select' the initial screen to view for SELinux Configuration.
+
+
+This application allows you to browse SELinux confinement per application.  You can enter the name of the application to see how SELinux confines it, or you could enter the SELinux name for the running process.
+
+Alternatively you can select to manage SELinux on the system, lockdown the system via SELinux.   You can also manage confined users and confined user mappings.  Finally you could setup File System Labeling equivalence.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/system.png b/policycoreutils/sepolicy/sepolicy/help/system.png
new file mode 100644
index 0000000000000000000000000000000000000000..3017bd4e3fc1855373920717df167904538c9b4b
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/system.txt b/policycoreutils/sepolicy/sepolicy/help/system.txt
new file mode 100644
index 0000000..ebbf3f1
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/system.txt
@@ -0,0 +1,2 @@
+This screen allows you to view modify the way SELinux is running on your system.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_boot_mode.png b/policycoreutils/sepolicy/sepolicy/help/system_boot_mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..be6e42f6d399aedefd47f4c3b96392f3975ac6ad
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_boot_mode.txt b/policycoreutils/sepolicy/sepolicy/help/system_boot_mode.txt
new file mode 100644
index 0000000..ce6e0f9
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/system_boot_mode.txt
@@ -0,0 +1,14 @@
+SELinux Systems can boot in three different modes.
+
+
+* Enforcing mode (Default)
+  - SELinux security policy is enforced.
+* Permissive 
+  - SELinux prints warnings instead of enforcing.
+* Disabled 
+  - No SELinux policy is loaded, SELinux does not run.
+
+You can use this screen to change the enforcing mode.  
+
+Note if you disable SELinux, you will need to to reboot, to turn it off.  Also the next time you turn SELinux on, a full system relabel will be performed.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_current_mode.png b/policycoreutils/sepolicy/sepolicy/help/system_current_mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..d12e7e2e106ca611c8430bc05134e8e3426f02dd
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_current_mode.txt b/policycoreutils/sepolicy/sepolicy/help/system_current_mode.txt
new file mode 100644
index 0000000..381db2c
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/system_current_mode.txt
@@ -0,0 +1,8 @@
+You can switch SELinux between Enforcing mode and Permissive mode.
+
+
+When a machine is in permissive mode, SELinux will continue to log SELinux AVC messages, that would have been denied if the machine was in enforcing mode.
+
+Changing the current mode of the system will not survive a reboot.  You would need to change the system mode for this.
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_export.png b/policycoreutils/sepolicy/sepolicy/help/system_export.png
new file mode 100644
index 0000000000000000000000000000000000000000..01235b7b42b00f31c38e11624bcce3c2777171f0
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_export.txt b/policycoreutils/sepolicy/sepolicy/help/system_export.txt
new file mode 100644
index 0000000..d80e495
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/system_export.txt
@@ -0,0 +1,8 @@
+SELinux allows you to export/import the current configuration of the machine.
+
+
+If you have several machines configured the same way you may want to modify the SELinux configuration on one machine and then export the configuration to a file.  Then you could copy that file to another machine and import it on that machine.
+
+Note, If you import a configuration to a machine, the local configuration will get removed.
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_policy_type.png b/policycoreutils/sepolicy/sepolicy/help/system_policy_type.png
new file mode 100644
index 0000000000000000000000000000000000000000..c6f555a57130cd74d4636449c47ce3900674a43a
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_policy_type.txt b/policycoreutils/sepolicy/sepolicy/help/system_policy_type.txt
new file mode 100644
index 0000000..84aaead
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/system_policy_type.txt
@@ -0,0 +1,6 @@
+If you have more then one policy type installed,  the advanced screen will become visible.  You can select the advanced tab and modify the policy type that SELinux is running with.
+
+Policy types are installed as sub-directories of /etc/selinux.  
+
+Changing the policy type of the machine will require a system relabeled in permissive mode. The gui will insure that proper labels get assigned on the next reboot. 
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_relabel.png b/policycoreutils/sepolicy/sepolicy/help/system_relabel.png
new file mode 100644
index 0000000000000000000000000000000000000000..644fa1596245b689d74a2eea6f35b2999fd8cd56
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/system_relabel.txt b/policycoreutils/sepolicy/sepolicy/help/system_relabel.txt
new file mode 100644
index 0000000..b3575f1
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/system_relabel.txt
@@ -0,0 +1,12 @@
+SELinux is a labeling system.  Sometimes the labels on disk can get messed up.  One way to fix this is to trigger a full relabel on the next boot.
+
+
+You can toggle this behavior using this screen.
+
+Note:  Sometimes a simple restorecon is all you need to fix the labels on a file or directory.
+
+If you add a new disk which does not have labels you could simply execute
+
+# restorecon -R -v PATHTODISK
+
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_file.png b/policycoreutils/sepolicy/sepolicy/help/transition_file.png
new file mode 100644
index 0000000000000000000000000000000000000000..1234e54d25fbdd2285b5f1a168ea85fbb1d35b3f
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_file.txt b/policycoreutils/sepolicy/sepolicy/help/transition_file.txt
new file mode 100644
index 0000000..1acff98
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/transition_file.txt
@@ -0,0 +1,16 @@
+This screen shows the 'file types' of the specified 'class' that will be created by processes running with '%(APP)s' type in the '%(APP)s' directory.
+
+
+SELinux allows policy writers to define file transition rules.  These rules define the label of a newly create file system object. 
+
+By default an newly created file system object will get the label of the directory the object is being created in. 
+
+Creating an file in a directory with the file type of etc_t will get the label etc_t.  In certain situations SELinux aware applications
+can override this behavior, for example the passwd command creates /etc/shadow with a type of shadow_t.
+
+A third option is for policy writers to write a transition rule.  For example a process labeled NetworkManager creating content in a directory labeled etc_t will create it with the label net_conf_t.  
+
+File Transition Rules can be written to create all objects of a particular class, or specific to a particular file name.
+
+You need to build a policy module if you want to add additional File Transition Rules.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from.png b/policycoreutils/sepolicy/sepolicy/help/transition_from.png
new file mode 100644
index 0000000000000000000000000000000000000000..26a6d43d4740099ed6b057166a2e78ba49b68c59
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from.txt b/policycoreutils/sepolicy/sepolicy/help/transition_from.txt
new file mode 100644
index 0000000..6b3bdfc
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/transition_from.txt
@@ -0,0 +1,11 @@
+This screen shows when a process running with the '%(APP)s' type executes 'Commands File Paths' that they will transition to the specified types.
+
+
+Under SELinux, when a process running with a 'type' attempts to execute an executable, one of three things can happen.  
+
+1.  The process can be prevented from running the executable.
+2.  The executable executes with the same label as parent.
+3.  The executable 'transitions' to a new 'type' based on policy.
+
+This screen shows the executables that transition to another domain when '%(APP)s' executes them, and the 'SELinux Application Type' of the newly created process.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean.png b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean.png
new file mode 100644
index 0000000000000000000000000000000000000000..f3d264229c368cbb7942f370d659b49f68752d00
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean.txt b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean.txt
new file mode 100644
index 0000000..de246c6
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean.txt
@@ -0,0 +1,9 @@
+Transitions can be controlled by SELinux Booleans.
+
+
+SELinux Booleans are If-then-else rules in policy, that allow the administrator to modify the access control on a process type.
+
+Transition rules are either always allowed or can be turned on and off based on the boolean settings.   If the 'Boolean Enabled' column has an arrow on it, this indicates the transition is controlled by a boolean.  
+
+Go to the next screen to see the effect of clicking on the arrow.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_1.png b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_1.png
new file mode 100644
index 0000000000000000000000000000000000000000..9e660f81f489bbf2f45bda0e8597ccc220104f0d
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_1.txt b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_1.txt
new file mode 100644
index 0000000..64aeef3
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_1.txt
@@ -0,0 +1,2 @@
+After selecting the arrow under Boolean Enabled column, the line will expand to show a link which you can click.  This will take you to the booleans page and allow you to enable the boolean which will enable or disable the transition.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_2.png b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_2.png
new file mode 100644
index 0000000000000000000000000000000000000000..98f4f4d01d7e24aa3e25793b1f2be5db847f4aca
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_2.txt b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_2.txt
new file mode 100644
index 0000000..0e32f39
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/transition_from_boolean_2.txt
@@ -0,0 +1,5 @@
+This screen shows you the boolean page with the boolean selected.
+
+
+Enable or disable the boolean to turn on or off the transition.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_to.png b/policycoreutils/sepolicy/sepolicy/help/transition_to.png
new file mode 100644
index 0000000000000000000000000000000000000000..49558d902b2b257aa3596a721196ba2fa87f607f
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/transition_to.txt b/policycoreutils/sepolicy/sepolicy/help/transition_to.txt
new file mode 100644
index 0000000..5743cd5
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/transition_to.txt
@@ -0,0 +1,11 @@
+This screen shows the SELinux process 'types' which will transition to the '%(APP)s' type when executing the 'Commands File Paths'.
+
+
+Under SELinux, when a process running with a 'type' attempts to execute an executable, one of three things can happen.  
+
+1.  The process can be prevented from running the executable.
+2.  The executable executes with the same label as parent.
+3.  The executable 'transitions' to a new 'type' based on policy.
+
+This screen shows the executables that transition to another domain when '%(APP)s' executes them, and the 'SELinux Application Type' of the newly created process.
+
diff --git a/policycoreutils/sepolicy/sepolicy/help/users.png b/policycoreutils/sepolicy/sepolicy/help/users.png
new file mode 100644
index 0000000000000000000000000000000000000000..2173d255c45e5ae868506b2fbe9b82f05c0b0724
GIT binary patch
diff --git a/policycoreutils/sepolicy/sepolicy/help/users.txt b/policycoreutils/sepolicy/sepolicy/help/users.txt
new file mode 100644
index 0000000..344b3d7
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/help/users.txt
@@ -0,0 +1,21 @@
+By Default on a SELinux Targeted Policy system, all users login using the unconfined_t user.
+
+SELinux has a very powerful concept called confined users.  You can setup individual users on your system to login with different SELinux user types.  This SELinux User Screen allows you to create/modify SELinux Users and map them to SELinux Roles and MLS/MCS Ranges
+
+Default SELinux Users:
+
+* Terminal user/ssh - guest_u
+  - No Network, No setuid, no exec in homedir
+
+* Browser user/kiosk - xguest_u
+  - Web access ports only.  No setuid, no exec in homedir
+
+* Full Desktop user - User_u
+  - Full Network, No SETUID.
+
+* Confined Admin/Desktop User - Staff_u 
+  - Full Network, sudo to admin only, no root password.  Usually a confined admin
+
+* Unconfined user - unconfined_u (Default)
+  - SELinux does not block access.
+
diff --git a/policycoreutils/sepolicy/sepolicy/interface.py b/policycoreutils/sepolicy/sepolicy/interface.py
index 8b063ca..53e4dc2 100644
--- a/policycoreutils/sepolicy/sepolicy/interface.py
+++ b/policycoreutils/sepolicy/sepolicy/interface.py
@@ -21,15 +21,12 @@
 #                                        02111-1307  USA
 #
 #
-import re
-
-import sepolgen.interfaces as interfaces
-import sepolgen.defaults as defaults
+import re, sys
+import sepolicy
 ADMIN_TRANSITION_INTERFACE = "_admin$"
 USER_TRANSITION_INTERFACE = "_role$"
-from sepolicy.generate import get_all_types
 
-__all__ = [ 'get', 'get_admin', 'get_user' ]
+__all__ = [ 'get_all_interfaces', 'get_interfaces_from_xml', 'get_admin', 'get_user' ,'get_interface_dict', 'get_interface_format_text', 'get_interface_compile_format_text', 'get_xml_file', 'interface_compile_test' ]
 
 ##
 ## I18N
@@ -48,34 +45,173 @@ except IOError:
     import __builtin__
     __builtin__.__dict__['_'] = unicode
 
-def get():
-    """ Get all Methods """
-    fn = defaults.interface_info()
-    try:
-        fd = open(fn)
-        ifs = interfaces.InterfaceSet()
-        ifs.from_file(fd)
-        methods = ifs.interfaces.keys()
-        fd.close()
-    except:
-        raise ValueError(_("could not open interface info [%s]\n") % fn)
-
-    return methods
-
-def get_admin():
-    """ Get all domains with an admin interface"""
+def get_interfaces_from_xml(path):
+    """ Get all interfaces from given xml file"""
+    interfaces_list = []
+    idict = get_interface_dict(path)
+    for k in idict.keys():
+        interfaces_list.append(k)
+    return interfaces_list
+
+
+def get_all_interfaces(path=""):
+    from sepolicy import get_methods
+    all_interfaces = []
+    if not path:
+        all_interfaces = get_methods()
+    else:
+        xml_path = get_xml_file(path)
+        all_interfaces = get_interfaces_from_xml(xml_path)
+
+    return all_interfaces
+
+def get_admin(path=""):
+    """ Get all domains with an admin interface from installed policy."""
+    """ If xml_path is specified, func returns an admin interface from specified xml file"""
     admin_list = []
-    for i in get():
-        if i.endswith("_admin"):
-            admin_list.append(i.split("_admin")[0])
+    if path:
+        try:
+            xml_path = get_xml_file(path)
+            idict = get_interface_dict(xml_path)
+            for k in idict.keys():
+                if k.endswith("_admin"):
+                    admin_list.append(k)    
+        except IOError, e:
+            sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e)))
+            sys.exit(1)
+    else:
+        for i in sepolicy.get_methods():
+            if i.endswith("_admin"):
+                admin_list.append(i.split("_admin")[0])
+
     return admin_list
 
-def get_user():
+def get_user(path=""):
     """ Get all domains with SELinux user role interface"""
+    """ If xml_path is specified, func returns an user role interface from specified xml file"""
     trans_list = []
-    for i in get():
-        m = re.findall("(.*)%s" % USER_TRANSITION_INTERFACE, i)
-        if len(m) > 0:
-            if "%s_exec_t" % m[0] in get_all_types():
-                trans_list.append(m[0])
+    if path:
+        try:
+            xml_path = get_xml_file(path)
+            idict = get_interface_dict(xml_path)
+            for k in idict.keys():
+                if k.endswith("_role"):
+                    if (("%s_exec_t" % k[:-5]) in sepolicy.get_all_types()):
+                        trans_list.append(k)
+        except IOError, e:
+            sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e)))
+            sys.exit(1)
+    else:
+        for i in sepolicy.get_methods():
+            m = re.findall("(.*)%s" % USER_TRANSITION_INTERFACE, i)
+            if len(m) > 0:
+                if "%s_exec_t" % m[0] in sepolicy.get_all_types():
+                    trans_list.append(m[0])
+
     return trans_list
+
+interface_dict = None
+def get_interface_dict(path="/usr/share/selinux/devel/policy.xml"):
+    global interface_dict
+    import os
+    import xml.etree.ElementTree
+    if interface_dict:
+        return interface_dict
+
+    interface_dict = {}
+    param_list = []
+
+    xml_path = """<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
+<policy>
+<layer name="admin">
+"""
+    xml_path += path
+    xml_path +="""
+</layer>
+</policy>
+"""
+
+    try:
+        if os.path.isfile(path):
+            tree = xml.etree.ElementTree.parse(path)
+        else:
+            tree = xml.etree.ElementTree.fromstring(xml_path)
+        for l in tree.findall("layer"):
+            for m in l.findall("module"):
+                for i in m.getiterator('interface'):
+                    for e in i.findall("param"):
+                        param_list.append(e.get('name'))
+                    interface_dict[(i.get("name"))] = [param_list,(i.find('summary').text),"interface"]
+                    param_list = []
+                for i in m.getiterator('template'):
+                    for e in i.findall("param"):
+                        param_list.append(e.get('name'))
+                    interface_dict[(i.get("name"))] = [param_list,(i.find('summary').text),"template"]
+                    param_list = []
+    except IOError, e:
+        pass
+    return interface_dict
+
+def get_interface_format_text(interface,path = "/usr/share/selinux/devel/policy.xml"):
+    idict = get_interface_dict(path)
+    interface_text = "%s(%s) %s" % (interface, ", ".join(idict[interface][0]), " ".join(idict[interface][1].split("\n")))
+
+    return interface_text
+
+def get_interface_compile_format_text(interfaces_dict, interface):
+    from templates import test_module
+    param_tmp = []
+    for i in interfaces_dict[interface][0]:
+        param_tmp.append(test_module.dict_values[i])
+        interface_text = "%s(%s)\n" % (interface, ", ".join(param_tmp))
+
+    return interface_text
+
+def generate_compile_te(interface, idict, name="compiletest"):
+    from templates import test_module
+    te = ""
+    te += re.sub("TEMPLATETYPE", name, test_module.te_test_module )
+    te += get_interface_compile_format_text(idict,interface)
+
+    return te
+
+def get_xml_file(if_file):
+    """ Returns xml format of interfaces for given .if policy file"""
+    import os, commands
+    basedir = os.path.dirname(if_file)+"/"
+    filename = os.path.basename(if_file).split(".")[0]
+    rc, output=commands.getstatusoutput("python /usr/share/selinux/devel/include/support/segenxml.py -w -m %s" % basedir+filename)
+    if rc != 0:
+        sys.stderr.write("\n Could not proceed selected interface file.\n")
+        sys.stderr.write("\n%s" % output)
+        sys.exit(1)
+    else:
+        return output
+
+def interface_compile_test(interface, path = "/usr/share/selinux/devel/policy.xml"):
+    exclude_interfaces = ["userdom","kernel","corenet","files", "dev"]
+    exclude_interface_type = ["template"]
+
+    import commands, os
+    policy_files = {'pp':"compiletest.pp", 'te':"compiletest.te", 'fc':"compiletest.fc", 'if':"compiletest.if"}
+    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))
+        try:
+            fd = open(policy_files['te'], "w")
+            fd.write(generate_compile_te(interface, idict))
+            fd.close()
+            rc, output=commands.getstatusoutput("make -f /usr/share/selinux/devel/Makefile %s" % policy_files['pp'] )
+            if rc != 0:
+                sys.stderr.write(output)
+                sys.stderr.write(_("\nCompile test for %s failed.\n") % interface)
+
+        except EnvironmentError, e:
+            sys.stderr.write(_("\nCompile test for %s has not run. %s\n") % (interface, e))
+        for v in policy_files.values():
+            if os.path.exists(v):
+                os.remove(v)
+
+    else:
+        sys.stderr.write(_("\nCompiling of %s interface is not supported." % interface))
diff --git a/policycoreutils/sepolicy/sepolicy/manpage.py b/policycoreutils/sepolicy/sepolicy/manpage.py
index 25062da..ba15b2c 100755
--- a/policycoreutils/sepolicy/sepolicy/manpage.py
+++ b/policycoreutils/sepolicy/sepolicy/manpage.py
@@ -28,12 +28,12 @@ import string
 import argparse
 import selinux
 import sepolicy
-from sepolicy import network, gen_bool_dict, get_all_file_types, get_all_domains, get_all_roles, get_all_users, get_all_port_types, get_all_bools, get_all_attributes, get_all_role_allows
+from sepolicy import *
 
 import commands
 import sys, os, re, time
 
-equiv_dict={ "smbd" : [ "samba" ], "httpd" : [ "apache" ], "virtd" : [ "virt", "libvirt" ], "named" : [ "bind" ], "fsdaemon" : [ "smartmon" ], "mdadm" : [ "raid" ] }
+equiv_dict={ "smbd" : [ "samba" ], "httpd" : [ "apache" ], "virtd" : [ "virt", "libvirt", "svirt", "svirt_tcg", "svirt_lxc_t", "svirt_lxc_net_t" ], "named" : [ "bind" ], "fsdaemon" : [ "smartmon" ], "mdadm" : [ "raid" ] }
 
 equiv_dirs=[ "/var" ]
 modules_dict = None
@@ -45,7 +45,7 @@ def gen_modules_dict(path = "/usr/share/selinux/devel/policy.xml"):
 	import xml.etree.ElementTree
 	modules_dict = {}
 	try:
-		tree = xml.etree.ElementTree.parse(path)
+		tree = xml.etree.ElementTree.fromstring(policy_xml(path))
 		for l in  tree.findall("layer"):
 			for m in  l.findall("module"):
 				name = m.get("name")
@@ -100,8 +100,8 @@ def gen_domains():
 	for d in get_all_domains():
 		found = False
 		domain = d[:-2]
-		if domain + "_exec_t" not in get_entrypoints():
-			continue
+#		if domain + "_exec_t" not in get_entrypoints():
+#			continue
 		if domain in domains:
 			continue
 		domains.append(domain)
@@ -114,39 +114,6 @@ def gen_domains():
 	domains.sort()
 	return domains
 
-fcdict=None
-def _gen_fcdict(fc_path = selinux.selinux_file_context_path()):
-	global fcdict
-	if fcdict:
-		return fcdict
-	fd = open(fc_path, "r")
-	fc = fd.readlines()
-	fd.close()
-	fd = open(fc_path+".homedirs", "r")
-	fc += fd.readlines()
-	fd.close()
-	fcdict = {}
-	for i in fc:
-		rec = i.split()
-		try:
-			t = rec[-1].split(":")[2]
-			if t in fcdict:
-				fcdict[t].append(rec[0])
-			else:
-				fcdict[t] = [ rec[0] ]
-		except:
-			pass
-	fcdict["logfile"] = [ "all log files" ]
-	fcdict["user_tmp_type"] = [ "all user tmp files" ]
-	fcdict["user_home_type"] = [ "all user home files" ]
-	fcdict["virt_image_type"] = [ "all virtual image files" ]
-	fcdict["noxattrfs"] = [ "all files on file systems which do not support extended attributes" ]
-	fcdict["sandbox_tmpfs_type"] = [ "all sandbox content in tmpfs file systems" ]
-	fcdict["user_tmpfs_type"] = [ "all user content in tmpfs file systems" ]
-	fcdict["file_type"] = [ "all files on the system" ]
-	fcdict["samba_share_t"] = [ "use this label for random content that will be shared using samba" ]
-	return fcdict
-
 types = None
 def _gen_types():
 	global types
@@ -184,14 +151,12 @@ def get_alphabet_manpages(manpage_list):
 	return alphabet_manpages
 
 def convert_manpage_to_html(html_manpage,manpage):
-	fd = open(html_manpage,'w')
-	rc, output = commands.getstatusoutput("man2html -r %s" % manpage)
+	rc, output = commands.getstatusoutput("/usr/bin/groff -man -Thtml %s 2>/dev/null" % manpage)
 	if rc == 0:
+		print html_manpage, " has been created"
+		fd = open(html_manpage,'w')
 		fd.write(output)
-	else:
-		fd.write("Man page does not exist")
-
-	fd.close()
+		fd.close()
 
 class HTMLManPages:
 	"""
@@ -416,56 +381,51 @@ class ManPage:
     """
 	Generate a Manpage on an SELinux domain in the specified path
     """
-    all_attributes = get_all_attributes()
-    all_domains = get_all_domains()
-    all_bools = get_all_bools()
-    all_port_types = get_all_port_types()
-    all_roles = get_all_roles()
-    all_users = get_all_users_info()[0]
-    all_users_range = get_all_users_info()[1]
-    all_file_types = get_all_file_types()
-    types = _gen_types()
     modules_dict = None
-    domains = gen_domains()
-    role_allows = get_all_role_allows()
     enabled_str = ["Disabled", "Enabled"]
 
-    def __init__(self, domainname, path = "/tmp", html = False):
+    def __init__(self, domainname, path = "/tmp", root="/", source_files = False ,html = False):
 	self.html = html
-	self.portrecs = network.portrecs
-
-	fcpath = path + "/file_contexts"
-	if os.path.exists(fcpath):
-		self.fcpath = fcpath
+	self.source_files = source_files
+	self.root = root
+	self.portrecs = gen_port_dict()[0]
+	self.domains = gen_domains()
+	self.all_domains = get_all_domains()
+	self.all_attributes = get_all_attributes()
+	self.all_bools = get_all_bools()
+	self.all_port_types = get_all_port_types()
+	self.all_roles = get_all_roles()
+	self.all_users = get_all_users_info()[0]
+	self.all_users_range = get_all_users_info()[1]
+	self.all_file_types = get_all_file_types()
+	self.role_allows = get_all_role_allows()
+	self.types = _gen_types()
+
+	if self.source_files:
+		self.fcpath = self.root + "file_contexts"
 	else:
-		self.fcpath = selinux.selinux_file_context_path()
-	self.fcdict = _gen_fcdict(self.fcpath)
+		self.fcpath = self.root + selinux.selinux_file_context_path()
+
+	self.fcdict = get_fcdict(self.fcpath)
 
 	if not os.path.exists(path):
 		os.makedirs(path)
+
 	self.path = path
 
-	xmlpath = path + "/policy.xml"
-	if os.path.exists(xmlpath):
-		self.xmlpath = xmlpath
+	if self.source_files:
+		self.xmlpath = self.root + "policy.xml"
 	else:
-		self.xmlpath = "/usr/share/selinux/devel/policy.xml"
+		self.xmlpath = self.root + "/usr/share/selinux/devel/policy.xml"
 	self.booleans_dict = gen_bool_dict(self.xmlpath)
 
-	if domainname.endswith("_t"):
-		self.domainname = domainname[:-2]
-	else:
-		self.domainname = domainname
-
-	if self.domainname + "_t" not in self.all_domains:
-		raise  ValueError("domain %s_t does not exist" % self.domainname)
-	self.short_name = self.domainname
+        self.domainname, self.short_name = gen_short_name(domainname)
 
 	self.type = self.domainname + "_t"
 	self._gen_bools()
 	self.man_page_path = "%s/%s_selinux.8" % (path, self.domainname)
 	self.fd = open(self.man_page_path, 'w')
-	if domainname + "_r" in self.all_roles:
+	if self.domainname + "_r" in self.all_roles:
 	    self.__gen_user_man_page()
 	    if self.html:
 		manpage_roles.append(self.man_page_path)
@@ -483,16 +443,16 @@ class ManPage:
     def _gen_bools(self):
 	    self.bools=[]
 	    self.domainbools=[]
-	    for i in map(lambda x: x['boolean'], filter(lambda x: 'boolean' in x, sepolicy.search([sepolicy.ALLOW],{'source' : self.type }))):
-		    for b in i:
-			    if not isinstance(b,tuple):
-				    continue
-			    if b[0].startswith(self.short_name):
-				    if b not in self.domainbools and (b[0], not b[1]) not in self.domainbools:
-					    self.domainbools.append(b)
-			    else:
-				    if b not in self.bools and (b[0], not b[1]) not in self.bools:
-					    self.bools.append(b)
+	    types = [self.type]
+	    if self.domainname in equiv_dict:
+		    for t in equiv_dict[self.domainname]:
+			    if t + "_t" in self.all_domains:
+				    types.append(t+"_t")
+
+	    for t in types:
+                    domainbools, bools = get_bools(t)
+                    self.bools += bools
+                    self.domainbools += domainbools
 
 	    self.bools.sort()
 	    self.domainbools.sort()
@@ -538,9 +498,6 @@ class ManPage:
 	    print path
 
     def __gen_man_page(self):
-	if self.domainname[-1]=='d':
-	    self.short_name = self.domainname[:-1]
-
 	self.anon_list = []
 
 	self.attributes = {}
@@ -563,22 +520,11 @@ class ManPage:
 
     def _get_ptypes(self):
 	for f in self.all_domains:
-	    if f.startswith(self.short_name):
-		self.ptypes.append(f)
-
-    def __whoami(self):
-	    import pwd
-	    fd = open("/proc/self/loginuid", "r")
-	    uid = int(fd.read())
-	    fd.close()
-	    pw = pwd.getpwuid(uid)
-	    if len(pw.pw_gecos) > 0:
-		    return pw.pw_gecos
-	    else:
-		    return pw.pw_name
+		if f.startswith(self.short_name) or f.startswith(self.domainname):
+			self.ptypes.append(f)
 
     def _header(self):
-	self.fd.write('.TH  "%(domainname)s_selinux"  "8"  "%(date)s" "%(domainname)s" "SELinux Policy documentation for %(domainname)s"'
+	self.fd.write('.TH  "%(domainname)s_selinux"  "8"  "%(date)s" "%(domainname)s" "SELinux Policy %(domainname)s"'
 		 % {'domainname':self.domainname, 'date': time.strftime("%y-%m-%d")})
 	self.fd.write(r"""
 .SH "NAME"
@@ -596,95 +542,6 @@ For example:
 """ % {'domainname':self.domainname})
 
 
-    def _explain(self, f):
-	if f.endswith("_var_run_t"):
-	    return "store the %s files under the /run or /var/run directory." % prettyprint(f, "_var_run_t")
-	if f.endswith("_pid_t"):
-	    return "store the %s files under the /run directory." % prettyprint(f, "_pid_t")
-	if f.endswith("_var_lib_t"):
-	    return "store the %s files under the /var/lib directory."  % prettyprint(f, "_var_lib_t")
-	if f.endswith("_var_t"):
-	    return "store the %s files under the /var directory."  % prettyprint(f, "_var_lib_t")
-	if f.endswith("_var_spool_t"):
-	    return "store the %s files under the /var/spool directory." % prettyprint(f, "_spool_t")
-	if f.endswith("_spool_t"):
-	    return "store the %s files under the /var/spool directory." % prettyprint(f, "_spool_t")
-	if f.endswith("_cache_t") or f.endswith("_var_cache_t"):
-	    return "store the files under the /var/cache directory."
-	if f.endswith("_keytab_t"):
-	    return "treat the files as kerberos keytab files."
-	if f.endswith("_lock_t"):
-	    return "treat the files as %s lock data, stored under the /var/lock directory" % prettyprint(f,"_lock_t")
-	if f.endswith("_log_t"):
-	    return "treat the data as %s log data, usually stored under the /var/log directory." % prettyprint(f,"_log_t")
-	if f.endswith("_config_t"):
-	    return "treat the files as %s configuration data, usually stored under the /etc directory." % prettyprint(f,"_config_t")
-	if f.endswith("_conf_t"):
-	    return "treat the files as %s configuration data, usually stored under the /etc directory." % prettyprint(f,"_conf_t")
-	if f.endswith("_exec_t"):
-	    return "transition an executable to the %s_t domain." % f[:-len("_exec_t")]
-	if f.endswith("_cgi_content_t"):
-	    return "treat the files as %s cgi content." % prettyprint(f, "_cgi_content_t")
-	if f.endswith("_rw_content_t"):
-	    return "treat the files as %s read/write content." % prettyprint(f,"_rw_content_t")
-	if f.endswith("_rw_t"):
-	    return "treat the files as %s read/write content." % prettyprint(f,"_rw_t")
-	if f.endswith("_write_t"):
-	    return "treat the files as %s read/write content." % prettyprint(f,"_write_t")
-	if f.endswith("_db_t"):
-	    return "treat the files as %s database content." % prettyprint(f,"_db_t")
-	if f.endswith("_ra_content_t"):
-	    return "treat the files as %s read/append content." % prettyprint(f,"_ra_conten_t")
-	if f.endswith("_cert_t"):
-	    return "treat the files as %s certificate data." % prettyprint(f,"_cert_t")
-	if f.endswith("_key_t"):
-	    return "treat the files as %s key data." % prettyprint(f,"_key_t")
-
-	if f.endswith("_secret_t"):
-	    return "treat the files as %s secret data." % prettyprint(f,"_key_t")
-
-	if f.endswith("_ra_t"):
-	    return "treat the files as %s read/append content." % prettyprint(f,"_ra_t")
-
-	if f.endswith("_ro_t"):
-	    return "treat the files as %s read/only content." % prettyprint(f,"_ro_t")
-
-	if f.endswith("_modules_t"):
-	    return "treat the files as %s modules." % prettyprint(f, "_modules_t")
-
-	if f.endswith("_content_t"):
-	    return "treat the files as %s content." % prettyprint(f, "_content_t")
-
-	if f.endswith("_state_t"):
-	    return "treat the files as %s state data." % prettyprint(f, "_state_t")
-
-	if f.endswith("_files_t"):
-	    return "treat the files as %s content." % prettyprint(f, "_files_t")
-
-	if f.endswith("_file_t"):
-	    return "treat the files as %s content." % prettyprint(f, "_file_t")
-
-	if f.endswith("_data_t"):
-	    return "treat the files as %s content." % prettyprint(f, "_data_t")
-
-	if f.endswith("_file_t"):
-	    return "treat the data as %s content." % prettyprint(f, "_file_t")
-
-	if f.endswith("_tmp_t"):
-	    return "store %s temporary files in the /tmp directories." % prettyprint(f, "_tmp_t")
-	if f.endswith("_etc_t"):
-	    return "store %s files in the /etc directories." % prettyprint(f, "_tmp_t")
-	if f.endswith("_home_t"):
-	    return "store %s files in the users home directory." % prettyprint(f, "_home_t")
-	if f.endswith("_tmpfs_t"):
-	    return "store %s files on a tmpfs file system." % prettyprint(f, "_tmpfs_t")
-	if f.endswith("_unit_file_t"):
-	    return "treat files as a systemd unit file."
-	if f.endswith("_htaccess_t"):
-	    return "treat the file as a %s access file." % prettyprint(f, "_htaccess_t")
-
-	return "treat the files as %s data." % prettyprint(f,"_t")
-
     def _format_boolean_desc(self, b):
 	    desc = self.booleans_dict[b][2][0].lower() + self.booleans_dict[b][2][1:]
 	    if desc[-1] == ".":
@@ -774,7 +631,7 @@ can be used to make the process type %(domainname)s_t permissive. SELinux does n
     def _port_types(self):
 	self.ports = []
 	for f in self.all_port_types:
-	    if f.startswith(self.short_name):
+            if f.startswith(self.short_name) or f.startswith(self.domainname):
 		self.ports.append(f)
 
 	if len(self.ports) == 0:
@@ -821,7 +678,7 @@ Default Defined Ports:""")
 		if f.startswith(self.domainname):
 			flist.append(f)
 			if f in self.fcdict:
-				mpaths = mpaths + self.fcdict[f]
+				mpaths = mpaths + self.fcdict[f]["regex"]
 	if len(mpaths) == 0:
 		return
 	mpaths.sort()
@@ -896,19 +753,19 @@ Note: SELinux often uses regular expressions to specify labels that match multip
 .B %s
 .EE
 
-- Set files with the %s type, if you want to %s
-""" % (f, f, self._explain(f)))
+- %s
+""" % ( f, sepolicy.get_description(f)))
 
 		if f in self.fcdict:
 		    plural = ""
-		    if len(self.fcdict[f]) > 1:
+		    if len(self.fcdict[f]["regex"]) > 1:
 			plural = "s"
 			self.fd.write("""
 .br
 .TP 5
 Path%s:
-%s""" % (plural, self.fcdict[f][0]))
-			for x in self.fcdict[f][1:]:
+%s""" % (plural, self.fcdict[f]["regex"][0]))
+			for x in self.fcdict[f]["regex"][1:]:
 			    self.fd.write(", %s" % x)
 
 	self.fd.write("""
@@ -923,13 +780,12 @@ to apply the labels.
 
     def _see_also(self):
 	    ret = ""
-	    prefix = self.short_name.split("_")[0]
 	    for d in self.domains:
 		    if d == self.domainname:
 			    continue
-		    if d.startswith(prefix):
+		    if d.startswith(self.short_name):
 			    ret += ", %s_selinux(8)" % d
-		    if self.domainname.startswith(d):
+		    if d.startswith(self.domainname + "_"):
 			    ret += ", %s_selinux(8)" % d
 	    self.fd.write(ret)
 
@@ -947,13 +803,14 @@ semanage fcontext -a -t public_content_t "/var/%(domainname)s(/.*)?"
 .B restorecon -F -R -v /var/%(domainname)s
 .pp
 .TP
-Allow %(domainname)s servers to read and write /var/tmp/incoming by adding the public_content_rw_t type to the directory and by restoring the file type.  This also requires the allow_%(domainname)sd_anon_write boolean to be set.
+Allow %(domainname)s servers to read and write /var/%(domainname)s/incoming by adding the public_content_rw_t type to the directory and by restoring the file type.  You also need to turn on the %(domainname)s_anon_write boolean.
 .PP
 .B
 semanage fcontext -a -t public_content_rw_t "/var/%(domainname)s/incoming(/.*)?"
 .br
 .B restorecon -F -R -v /var/%(domainname)s/incoming
-
+.br
+.B setsebool -P %(domainname)s_anon_write 1
 """  % {'domainname':self.domainname})
 	    for b in self.anon_list:
 		desc = self.booleans_dict[b][2][0].lower() + self.booleans_dict[b][2][1:]
@@ -998,12 +855,11 @@ is a GUI tool available to customize SELinux policy settings.
 
 .SH AUTHOR
 This manual page was auto-generated using
-.B "sepolicy manpage"
-by %s.
+.B "sepolicy manpage".
 
 .SH "SEE ALSO"
 selinux(8), %s(8), semanage(8), restorecon(8), chcon(1), sepolicy(8)
-""" % (self.__whoami(), self.domainname))
+""" % (self.domainname))
 
 	if self.booltext != "":
 	    self.fd.write(", setsebool(8)")
@@ -1046,7 +902,7 @@ All executeables with the default executable label, usually stored in /usr/bin a
 	paths=[]
 	for entrypoint in entrypoints:
 		if entrypoint in self.fcdict:
-			paths += self.fcdict[entrypoint]
+			paths += self.fcdict[entrypoint]["regex"]
 
 	self.fd.write("""
 %s""" % ", ".join(paths))
@@ -1086,7 +942,7 @@ The SELinux process type %s_t can manage files labeled with the following file t
 
 """ % f)
 	    if f in self.fcdict:
-		for path in self.fcdict[f]:
+		for path in self.fcdict[f]["regex"]:
 		    self.fd.write("""\t%s
 .br
 """ % path)
@@ -1230,6 +1086,7 @@ The SELinux user %s_u is not able to terminal login.
 """ % self.domainname)
 
     def _network(self):
+        from sepolicy import network
 	self.fd.write("""
 .SH NETWORK
 """)
@@ -1241,10 +1098,10 @@ The SELinux user %s_u is not able to terminal login.
 The SELinux user %s_u is able to listen on the following %s ports.
 """ % (self.domainname, net))
 		for p in portdict:
-		    for recs in portdict[p]:
+		    for t, ports in portdict[p]:
 			self.fd.write("""
 .B %s
-""" % recs)
+""" % ",".join(ports))
 	    portdict = network.get_network_connect(self.type, "tcp", "name_connect")
 	    if len(portdict) > 0:
 		self.fd.write("""
@@ -1252,10 +1109,10 @@ The SELinux user %s_u is able to listen on the following %s ports.
 The SELinux user %s_u is able to connect to the following tcp ports.
 """ % (self.domainname))
 		for p in portdict:
-		    for recs in portdict[p]:
+		    for t, ports in portdict[p]:
 			self.fd.write("""
 .B %s
-""" % recs)
+""" % ",".join(ports))
 
     def _home_exec(self):
 	permlist = sepolicy.search([sepolicy.ALLOW],{'source':self.type,'target':'user_home_type', 'class':'file', 'permlist':['ioctl', 'read', 'getattr', 'execute', 'execute_no_trans', 'open']})
diff --git a/policycoreutils/sepolicy/sepolicy/network.py b/policycoreutils/sepolicy/sepolicy/network.py
index 66efe26..3a75d7c 100755
--- a/policycoreutils/sepolicy/sepolicy/network.py
+++ b/policycoreutils/sepolicy/sepolicy/network.py
@@ -20,52 +20,26 @@
 #                                        02111-1307  USA
 #
 #  
-import sys
 import sepolicy
 search=sepolicy.search
 info=sepolicy.info
 
-def _gen_port_dict():
-    portrecsbynum = {}
-    portrecs = {}
-    for i in info(sepolicy.PORT):
-        if i['low'] == i['high']:
-            port = str(i['low'])
-        else:
-            port = "%s-%s" % (str(i['low']), str(i['high']))
-
-        if (i['type'], i['protocol']) in portrecs:
-            portrecs [(i['type'], i['protocol'])].append(port)
-        else:
-            portrecs [(i['type'], i['protocol'])] = [port]
-
-        portrecsbynum[(i['low'], i['high'],i['protocol'])] = (i['type'], i['range'])
-    return ( portrecs, portrecsbynum )
-portrecs, portrecsbynum = _gen_port_dict()
-
-port_types =  sepolicy.info(sepolicy.ATTRIBUTE,"port_type")[0]["types"]
-domains =  sepolicy.info(sepolicy.ATTRIBUTE,"domain")[0]["types"]
-
 def get_types(src, tclass, perm):
     allows=search([sepolicy.ALLOW],{sepolicy.SOURCE:src,sepolicy.CLASS:tclass, sepolicy.PERMS:perm})
     nlist=[]
     if allows:
-        for i in map(lambda y: y[sepolicy.TARGET], filter(lambda x: set(perm).issubset(x[sepolicy.PERMS]) and x['enabled'], allows)):
+        for i in map(lambda y: y[sepolicy.TARGET], filter(lambda x: set(perm).issubset(x[sepolicy.PERMS]), allows)):
             if i not in nlist:
                 nlist.append(i)
     return nlist
    
 
 def get_network_connect(src, protocol, perm):
+    portrecs, portrecsbynum = sepolicy.gen_port_dict()
     d={}
     tlist = get_types(src, "%s_socket" % protocol, [perm])
     if len(tlist) > 0:
-        if "port_type" in tlist:
-            d[(src,protocol,perm)] = ["all ports"]
-            return d
-
         d[(src,protocol,perm)] = []
-
         for i in tlist:
             if i == "ephemeral_port_type":
                 if "unreserved_port_type" in tlist:
@@ -77,16 +51,18 @@ def get_network_connect(src, protocol, perm):
                 if "port_t" in tlist:
                     continue
             if i == "port_t":
-                d[(src,protocol,perm)].append("all ports with out defined types")
+                d[(src,protocol,perm)].append((i, ["all ports with out defined types"]))
+            if i == "port_type":
+                d[(src,protocol,perm)].append((i, ["all ports"]))
             elif i == "unreserved_port_type":
-                d[(src,protocol,perm)].append("%s: all ports > 1024" % i)
+                d[(src,protocol,perm)].append((i, ["all ports > 1024"]))
             elif i == "reserved_port_type":
-                d[(src,protocol,perm)].append("%s: all ports < 1024" % i)
+                d[(src,protocol,perm)].append((i, ["all ports < 1024"]))
             elif i == "rpc_port_type":
-                d[(src,protocol,perm)].append("%s: all ports > 500 and  < 1024" % i)
+                d[(src,protocol,perm)].append((i, ["all ports > 500 and  < 1024"]))
             else:
                 try:
-                    d[(src,protocol,perm)].append("%s: %s" % (i, ",".join(portrecs[(i, protocol)])))
+                    d[(src,protocol,perm)].append((i, portrecs[(i, protocol)]))
                 except KeyError:
                     pass
     return d
diff --git a/policycoreutils/sepolicy/sepolicy/sedbus.py b/policycoreutils/sepolicy/sepolicy/sedbus.py
new file mode 100644
index 0000000..c6645ef
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/sedbus.py
@@ -0,0 +1,58 @@
+import sys
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+from slip.dbus import polkit
+
+class SELinuxDBus (object):
+    def __init__ (self):
+        self.bus = dbus.SystemBus()
+        self.dbus_object = self.bus.get_object("org.selinux", "/org/selinux/object")
+
+    @polkit.enable_proxy
+    def semanage (self, buf):
+        ret = self.dbus_object.semanage(buf, dbus_interface = "org.selinux")
+        return ret
+
+    @polkit.enable_proxy
+    def restorecon (self, path):
+        ret = self.dbus_object.restorecon(path, dbus_interface = "org.selinux")
+        return ret
+
+    @polkit.enable_proxy
+    def setenforce (self, value):
+        ret = self.dbus_object.setenforce(value, dbus_interface = "org.selinux")
+        return ret
+
+    @polkit.enable_proxy
+    def customized (self):
+        ret = self.dbus_object.customized(dbus_interface = "org.selinux")
+        return ret
+
+    @polkit.enable_proxy
+    def semodule_list (self):
+        ret = self.dbus_object.semodule_list(dbus_interface = "org.selinux")
+        return ret
+
+    @polkit.enable_proxy
+    def relabel_on_boot(self, value):
+        ret = self.dbus_object.relabel_on_boot(value, dbus_interface = "org.selinux")
+        return ret
+
+    @polkit.enable_proxy
+    def change_default_mode(self, value):
+        ret = self.dbus_object.change_default_mode(value, dbus_interface = "org.selinux")
+        return ret
+
+    @polkit.enable_proxy
+    def change_default_policy(self, value):
+        ret = self.dbus_object.change_default_policy(value, dbus_interface = "org.selinux")
+        return ret
+
+if __name__ == "__main__":
+    try:
+        dbus_proxy = SELinuxDBus()
+        resp = dbus_proxy.setenforce(int(sys.argv[1]))
+        print (resp)
+    except dbus.DBusException, e:
+        print e
diff --git a/policycoreutils/sepolicy/sepolicy/sepolicy.glade b/policycoreutils/sepolicy/sepolicy/sepolicy.glade
new file mode 100644
index 0000000..c096579
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/sepolicy.glade
@@ -0,0 +1,5633 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Fri Oct 11 08:24:19 2013 -->
+<interface>
+  <!-- interface-requires gtk+ 3.8 -->
+  <object class="GtkListStore" id="Advanced_search_liststore">
+    <columns>
+      <!-- column-name Application -->
+      <column type="gchararray"/>
+      <!-- column-name Path -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkWindow" id="Main_selection_menu">
+    <property name="can_focus">False</property>
+    <property name="default_width">265</property>
+    <property name="default_height">100</property>
+    <property name="decorated">False</property>
+    <child>
+      <object class="GtkBox" id="vbox2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkButton" id="app_button">
+            <property name="label" translatable="yes">Applications</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="receives_default">False</property>
+            <property name="events"/>
+            <property name="double_buffered">False</property>
+            <property name="relief">none</property>
+            <property name="focus_on_click">False</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="hbox10">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_left">10</property>
+            <child>
+              <object class="GtkEntry" id="completion_entry">
+                <property name="width_request">210</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">●</property>
+                <property name="text" translatable="yes">Select domain</property>
+                <property name="primary_icon_stock">gtk-find</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <signal name="activate" handler="on_SELinux_window_configure_event" swapped="no"/>
+                <signal name="changed" handler="on_completion_entry_changed" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="padding">10</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="main_advanced_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_left">10</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Advanced Search &gt;&gt;</property>
+            <property name="selectable">True</property>
+            <attributes>
+              <attribute name="foreground" value="#00004e4e9999"/>
+            </attributes>
+            <signal name="button-press-event" handler="on_main_advanced_label_button_press_event" swapped="no"/>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="app_file_equiv_button">
+            <property name="label" translatable="yes">File Equivalence</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="relief">none</property>
+            <property name="focus_on_click">False</property>
+            <property name="xalign">0</property>
+            <signal name="clicked" handler="on_file_equiv_button_clicked" swapped="no"/>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="app_users_button">
+            <property name="label" translatable="yes">Users</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="relief">none</property>
+            <property name="focus_on_click">False</property>
+            <property name="xalign">0</property>
+            <signal name="clicked" handler="on_app/users_button_clicked" swapped="no"/>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">4</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="app_system_button">
+            <property name="label" translatable="yes">System</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="relief">none</property>
+            <property name="focus_on_click">False</property>
+            <property name="xalign">0</property>
+            <signal name="clicked" handler="on_app/system_button_clicked" swapped="no"/>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">5</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkTreeStore" id="Update_treestore">
+    <columns>
+      <!-- column-name Select -->
+      <column type="gboolean"/>
+      <!-- column-name Description -->
+      <column type="gchararray"/>
+      <!-- column-name Action -->
+      <column type="gchararray"/>
+      <!-- column-name Visible -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkFileChooserDialog" id="add_path_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="role">GtkFileChooserDialog</property>
+    <property name="modal">True</property>
+    <property name="type_hint">normal</property>
+    <property name="action">save</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="filechooserdialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <signal name="button-press-event" handler="on_choose_file" swapped="no"/>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="filechooserdialog-action_area1">
+            <property name="can_focus">False</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="select_button_filechooser">
+                <property name="label" translatable="yes">Select</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_choose_file" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_button_filechooser">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkTreeModelFilter" id="advanced_filter">
+    <property name="child_model">Advanced_search_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="advanced_sort">
+    <property name="model">advanced_filter</property>
+  </object>
+  <object class="GtkTreeStore" id="application_files_treestore">
+    <columns>
+      <!-- column-name file -->
+      <column type="gchararray"/>
+      <!-- column-name Description -->
+      <column type="gchararray"/>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+      <!-- column-name Label -->
+      <column type="gboolean"/>
+      <!-- column-name Mislabled -->
+      <column type="gboolean"/>
+      <!-- column-name Cur -->
+      <column type="gchararray"/>
+      <!-- column-name Con -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="application_files_filter">
+    <property name="child_model">application_files_treestore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="application_files_sort">
+    <property name="model">application_files_filter</property>
+  </object>
+  <object class="GtkListStore" id="application_liststore">
+    <columns>
+      <!-- column-name Application -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="application_filter">
+    <property name="child_model">application_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="application_sort">
+    <property name="model">application_filter</property>
+  </object>
+  <object class="GtkListStore" id="application_tree_list">
+    <columns>
+      <!-- column-name Process -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="boolean_liststore">
+    <columns>
+      <!-- column-name Active -->
+      <column type="gboolean"/>
+      <!-- column-name Description -->
+      <column type="gchararray"/>
+      <!-- column-name Name -->
+      <column type="gchararray"/>
+      <!-- column-name More.. -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="boolean_filter">
+    <property name="child_model">boolean_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="boolean_sort">
+    <property name="model">boolean_filter</property>
+  </object>
+  <object class="GtkListStore" id="booleans_more_detail_liststore">
+    <columns>
+      <!-- column-name Detail -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="files_delete_liststore">
+    <columns>
+      <!-- column-name Select -->
+      <column type="gboolean"/>
+      <!-- column-name Path -->
+      <column type="gchararray"/>
+      <!-- column-name Label -->
+      <column type="gchararray"/>
+      <!-- column-name Class -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="network_delete_liststore">
+    <columns>
+      <!-- column-name Select -->
+      <column type="gboolean"/>
+      <!-- column-name Port -->
+      <column type="gchararray"/>
+      <!-- column-name Protocol -->
+      <column type="gchararray"/>
+      <!-- column-name Type -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkEntryCompletion" id="entrycompletion_obj">
+    <signal name="match-selected" handler="on_SELinux_window_configure_event" swapped="no"/>
+    <signal name="match-selected" handler="on_completion_entry_changed" swapped="no"/>
+    <signal name="match-selected" handler="on_entrycompletion_obj_match_selected" swapped="no"/>
+  </object>
+  <object class="GtkWindow" id="error_check_window">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">440</property>
+    <property name="default_height">250</property>
+    <property name="transient_for">SELinux_window</property>
+    <child>
+      <object class="GtkBox" id="vbox27">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="error_check_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">The entry that was entered is incorrect.  Please try again in the ex:/.../... format.</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="hbox22">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="label20">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="retry_button_files">
+                <property name="label" translatable="yes">Retry</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_retry_button_files_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label21">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkTreeStore" id="executable_files_treestore">
+    <columns>
+      <!-- column-name Executable -->
+      <column type="gchararray"/>
+      <!-- column-name SELinux -->
+      <column type="gchararray"/>
+      <!-- column-name Class -->
+      <column type="gchararray"/>
+      <!-- column-name Fix -->
+      <column type="gboolean"/>
+      <!-- column-name Mislabled -->
+      <column type="gboolean"/>
+      <!-- column-name Cur -->
+      <column type="gchararray"/>
+      <!-- column-name Con -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="executable_files_filter">
+    <property name="child_model">executable_files_treestore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="executable_files_sort">
+    <property name="model">executable_files_filter</property>
+  </object>
+  <object class="GtkListStore" id="file_equiv_delete_liststore">
+    <columns>
+      <!-- column-name Select -->
+      <column type="gboolean"/>
+      <!-- column-name Source -->
+      <column type="gchararray"/>
+      <!-- column-name Destination -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="file_equiv_liststore">
+    <columns>
+      <!-- column-name Source -->
+      <column type="gchararray"/>
+      <!-- column-name Destination -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="file_equiv_filter">
+    <property name="child_model">file_equiv_liststore</property>
+  </object>
+  <object class="GtkWindow" id="file_equiv_popup_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Network Port Definitions</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="transient_for">SELinux_window</property>
+    <child>
+      <object class="GtkBox" id="vbox12">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="file_equiv_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Add file Equivilence Mapping.  Mapping will be created when Update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTable" id="table5">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="n_rows">3</property>
+            <property name="n_columns">2</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label24">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Path</property>
+              </object>
+              <packing>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="file_equiv_source_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Specify a new SELinux user name.  By convention SELinux User names usually end in an _u.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <property name="primary_icon_tooltip_text" translatable="yes">Enter the path to which you want to setup an equivalence label.</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label25">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Equivalence Path</property>
+              </object>
+              <packing>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="hbox4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkButton" id="save_changes_file_equiv">
+                    <property name="label" translatable="yes">Save to update</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_save_changes_file_equiv_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="cancel_file_equiv">
+                    <property name="label" translatable="yes">Cancel</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="file_equiv_dest_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Specify the mapping between the new path and the equivalence path.  Everything under this new path will be labeled as if they were under the equivalence path.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkTreeModelSort" id="file_equiv_sort">
+    <property name="model">file_equiv_filter</property>
+  </object>
+  <object class="GtkListStore" id="file_transitions_liststore">
+    <columns>
+      <!-- column-name Dir -->
+      <column type="gchararray"/>
+      <!-- column-name Class -->
+      <column type="gchararray"/>
+      <!-- column-name Destination -->
+      <column type="gchararray"/>
+      <!-- column-name file -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="file_transitions_filter">
+    <property name="child_model">file_transitions_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="file_transitions_sort">
+    <property name="model">file_transitions_filter</property>
+  </object>
+  <object class="GtkListStore" id="files_class_combo_store">
+    <columns>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="files_type_combo_store">
+    <columns>
+      <!-- column-name Type -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkWindow" id="files_popup_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Add a file</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox20">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="files_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">&lt;operation&gt; File Labeling for &lt;selected domain&gt;. File labels will be created when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTable" id="table2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="n_rows">7</property>
+            <property name="n_columns">2</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkBox" id="hbox23">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkButton" id="save_changes_files">
+                    <property name="label" translatable="yes">Save to update</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_save_changes_files_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="cancel_files">
+                    <property name="label" translatable="yes">Cancel</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="files_mls_label">
+                <property name="width_request">40</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">MLS</property>
+              </object>
+              <packing>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="Advanced_text_files">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Advanced &gt;&gt;</property>
+                <property name="selectable">True</property>
+                <attributes>
+                  <attribute name="foreground" value="#00004e4e9999"/>
+                </attributes>
+                <signal name="button-press-event" handler="on_Advanced_text_files_button_press_event" swapped="no"/>
+              </object>
+              <packing>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="width_request">40</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Class</property>
+              </object>
+              <packing>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="width_request">40</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Type</property>
+              </object>
+              <packing>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="files_class_combobox">
+                <property name="width_request">360</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="tooltip_text" translatable="yes">Select the file class to which this label will be applied.  Defaults to all classes.</property>
+                <property name="model">files_class_combo_store</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext23"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="vbox22">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkBox" id="hbox11">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkCheckButton" id="make_path_recursive">
+                        <property name="label" translatable="yes">Make Path Recursive</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Select Make Path Recursive iff you want to apply this label to all children of the specified directory path. objects under the directory to have this label.</property>
+                        <property name="xalign">0.5</property>
+                        <property name="draw_indicator">True</property>
+                        <signal name="toggled" handler="on_make_path_recursive_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="Browse_button_files">
+                        <property name="label" translatable="yes">Browse</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="tooltip_text" translatable="yes">Browse to select the file/directory for labeling.</property>
+                        <signal name="clicked" handler="on_Browse_button_files_clicked" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="hbox25">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Path  </property>
+              </object>
+              <packing>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="files_path_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Specify the path using regular expressions that you would like to modify the labeling.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <signal name="button-press-event" handler="on_files_path_entry_button_press_event" swapped="no"/>
+                <signal name="changed" handler="on_files_path_entry_changed" swapped="no"/>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="vbox25">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkComboBox" id="files_type_combobox">
+                    <property name="width_request">360</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="tooltip_text" translatable="yes">Select the SELinux file type to assign to this path.</property>
+                    <property name="model">files_type_combo_store</property>
+                    <signal name="changed" handler="on_files_type_combobox_changed" swapped="no"/>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext26"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="files_mls_entry">
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Enter the MLS Label to assign to this file path.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <property name="primary_icon_tooltip_text" translatable="yes">SELinux MLS Label you wish to assign to this path.</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkDialog" id="help_window">
+    <property name="can_focus">False</property>
+    <property name="resizable">False</property>
+    <property name="default_width">200</property>
+    <property name="default_height">500</property>
+    <property name="type_hint">normal</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="back_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_back_button_clicked" swapped="no"/>
+                <child>
+                  <object class="GtkArrow" id="arrow2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="arrow_type">left</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="forward_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_forward_button_clicked" swapped="no"/>
+                <child>
+                  <object class="GtkArrow" id="arrow3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box9">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkScrolledWindow" id="scrolledwindow14">
+                <property name="height_request">250</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object class="GtkTextView" id="help_textv">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="editable">False</property>
+                    <property name="wrap_mode">word</property>
+                    <property name="cursor_visible">False</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="help_image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="pixbuf">images/booleans.png</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkListStore" id="liststore1"/>
+  <object class="GtkWindow" id="loading_gui">
+    <property name="width_request">300</property>
+    <property name="height_request">25</property>
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Analyzing Policy...</property>
+    <property name="resizable">False</property>
+    <property name="window_position">mouse</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkProgressBar" id="progress_bar">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="pulse_step">0.050000000223517416</property>
+        <property name="show_text">True</property>
+      </object>
+    </child>
+  </object>
+  <object class="GtkListStore" id="login_delete_liststore">
+    <columns>
+      <!-- column-name Select -->
+      <column type="gboolean"/>
+      <!-- column-name SELinuxLogin -->
+      <column type="gchararray"/>
+      <!-- column-name SELinuxUsername -->
+      <column type="gchararray"/>
+      <!-- column-name Level -->
+      <column type="gchararray"/>
+      <!-- column-name Range -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="login_liststore">
+    <columns>
+      <!-- column-name Username -->
+      <column type="gchararray"/>
+      <!-- column-name SELinuxUser -->
+      <column type="gchararray"/>
+      <!-- column-name MLS -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="login_filter">
+    <property name="child_model">login_liststore</property>
+  </object>
+  <object class="GtkListStore" id="login_seuser_liststore">
+    <columns>
+      <!-- column-name SELinuxUser -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkWindow" id="login_popup_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Network Port Definitions</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox10">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="Login_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Add Login Mapping. Login Mapping will be created when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTable" id="table1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="n_rows">4</property>
+            <property name="n_columns">2</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label15">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Login Name</property>
+              </object>
+              <packing>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="login_name_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Enter the login user name of the user to which you wish to add SELinux User confinement.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label17">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">SELinux User</property>
+              </object>
+              <packing>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="login_seuser_combobox">
+                <property name="width_request">360</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="tooltip_text" translatable="yes">Select the SELinux User to assign to this login user.  Login users by default get assigned by the __default__ user.</property>
+                <property name="model">login_seuser_liststore</property>
+                <signal name="changed" handler="on_login_seuser_combobox_changed" swapped="no"/>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext51"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="hbox2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkButton" id="save_changes_login">
+                    <property name="label" translatable="yes">Save to update</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_save_changes_login_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="cancel_login">
+                    <property name="label" translatable="yes">Cancel</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="login_mls_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="tooltip_text" translatable="yes">Enter MLS/MCS Range for this login User.  Defaults to the range for the Selected SELinux User.</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">MLS Range</property>
+              </object>
+              <packing>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="login_mls_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Specify the MLS Range for this user to login in with.  Defaults to the selected SELinux Users MLS Range.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkTreeModelSort" id="login_sort">
+    <property name="model">login_filter</property>
+  </object>
+  <object class="GtkListStore" id="modify_liststore_files">
+    <columns>
+      <!-- column-name Path -->
+      <column type="gchararray"/>
+      <!-- column-name file -->
+      <column type="gchararray"/>
+      <!-- column-name Class -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="more_types_file_liststore">
+    <columns>
+      <!-- column-name types -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="network_in_liststore">
+    <columns>
+      <!-- column-name Port -->
+      <column type="gchararray"/>
+      <!-- column-name Protocol -->
+      <column type="gchararray"/>
+      <!-- column-name Modified -->
+      <column type="gchararray"/>
+      <!-- column-name SELinux -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="network_in_filter">
+    <property name="child_model">network_in_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="network_in_sort">
+    <property name="model">network_in_filter</property>
+  </object>
+  <object class="GtkListStore" id="network_out_liststore">
+    <columns>
+      <!-- column-name Port -->
+      <column type="gchararray"/>
+      <!-- column-name Protocol -->
+      <column type="gchararray"/>
+      <!-- column-name Modified -->
+      <column type="gchararray"/>
+      <!-- column-name SELinux -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="network_out_filter">
+    <property name="child_model">network_out_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="network_out_sort">
+    <property name="model">network_out_filter</property>
+  </object>
+  <object class="GtkListStore" id="network_type_combo_store">
+    <columns>
+      <!-- column-name Type -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkWindow" id="network_popup_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Network Port Definitions</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox23">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="Network_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">&lt;operation&gt; Network Port for &lt;selected domain&gt;.  Ports will be created when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTable" id="table4">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="n_rows">6</property>
+            <property name="n_columns">2</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label14">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Port Number</property>
+              </object>
+              <packing>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="network_ports_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Enter the port number or range to which you want to add a port type.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label6">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Protocol</property>
+              </object>
+              <packing>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label7">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Port Type</property>
+              </object>
+              <packing>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="Advanced_text_network">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Advanced &gt;&gt;</property>
+                <property name="selectable">True</property>
+                <attributes>
+                  <attribute name="foreground" value="#00004e4e9999"/>
+                </attributes>
+                <signal name="button-press-event" handler="on_Advanced_text_files_button_press_event" swapped="no"/>
+              </object>
+              <packing>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="network_mls_label">
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">MLS</property>
+              </object>
+              <packing>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="network_type_combobox">
+                <property name="width_request">360</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="tooltip_text" translatable="yes">Select the port type you want to assign to the specified port number.</property>
+                <property name="model">network_type_combo_store</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext33"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="hbox14">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkButton" id="save_changes_network">
+                    <property name="label" translatable="yes">Save to update</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_save_changes_network_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="cancel_network">
+                    <property name="label" translatable="yes">Cancel</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="hbox28">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkRadioButton" id="tcp_button">
+                    <property name="label" translatable="yes">tcp</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_markup" translatable="yes">Select &lt;b&gt;tcp&lt;/b&gt; if the port type should be assigned to tcp port numbers.</property>
+                    <property name="xalign">0.5</property>
+                    <property name="active">True</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkRadioButton" id="udp_button">
+                    <property name="label" translatable="yes">udp</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_markup" translatable="yes">Select &lt;b&gt;udp&lt;/b&gt; if the port type should be assigned to udp port numbers.</property>
+                    <property name="xalign">0.5</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">tcp_button</property>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="network_mls_entry">
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Enter the MLS Label to assign to this port.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkListStore" id="system_policy_type_liststore">
+    <columns>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeStore" id="transitions_from_treestore">
+    <columns>
+      <!-- column-name Enabled -->
+      <column type="gchararray"/>
+      <!-- column-name boolnames -->
+      <column type="gchararray"/>
+      <!-- column-name Executable -->
+      <column type="gchararray"/>
+      <!-- column-name Transtype -->
+      <column type="gchararray"/>
+      <!-- column-name Text -->
+      <column type="gchararray"/>
+      <!-- column-name Activate -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="transitions_from_filter">
+    <property name="child_model">transitions_from_treestore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="transitions_from_sort">
+    <property name="model">transitions_from_filter</property>
+  </object>
+  <object class="GtkListStore" id="transitions_into_liststore">
+    <columns>
+      <!-- column-name Activate -->
+      <column type="gchararray"/>
+      <!-- column-name Source -->
+      <column type="gchararray"/>
+      <!-- column-name Executable -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="transitions_into_filter">
+    <property name="child_model">transitions_into_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="transitions_into_sort">
+    <property name="model">transitions_into_filter</property>
+  </object>
+  <object class="GtkListStore" id="user_delete_liststore">
+    <columns>
+      <!-- column-name Select -->
+      <column type="gboolean"/>
+      <!-- column-name SELinuxLogin -->
+      <column type="gchararray"/>
+      <!-- column-name SELinuxUsername -->
+      <column type="gchararray"/>
+      <!-- column-name Level -->
+      <column type="gchararray"/>
+      <!-- column-name Range -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="user_liststore">
+    <columns>
+      <!-- column-name SELinuxUsername -->
+      <column type="gchararray"/>
+      <!-- column-name SELinuxRoles -->
+      <column type="gchararray"/>
+      <!-- column-name Default -->
+      <column type="gchararray"/>
+      <!-- column-name MLSRange -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="user_roles_liststore">
+    <columns>
+      <!-- column-name SELinuxRoles -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkWindow" id="SELinux_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">SELinux Configuration</property>
+    <property name="window_position">center-always</property>
+    <property name="default_width">650</property>
+    <property name="default_height">420</property>
+    <signal name="configure-event" handler="on_SELinux_window_configure_event" swapped="no"/>
+    <signal name="delete-event" handler="on_confirmation_close" swapped="no"/>
+    <signal name="focus-in-event" handler="on_SELinux_window_configure_event" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkBox" id="hbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkBox" id="vbox4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkBox" id="box100">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkAspectFrame" id="aspectframe1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <child>
+                          <object class="GtkBox" id="hbox12">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkButton" id="applications_selection_button">
+                                <property name="label" translatable="yes">Select...</property>
+                                <property name="width_request">240</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="receives_default">True</property>
+                                <property name="relief">none</property>
+                                <property name="focus_on_click">False</property>
+                                <property name="xalign">0</property>
+                                <property name="image_position">bottom</property>
+                                <signal name="clicked" handler="on_combo_button_clicked" swapped="no"/>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="button1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="receives_default">True</property>
+                                <property name="relief">none</property>
+                                <signal name="clicked" handler="on_combo_button_clicked" swapped="no"/>
+                                <child>
+                                  <object class="GtkArrow" id="arrow1">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="arrow_type">down</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="Booleans_button">
+                        <property name="label" translatable="yes">Booleans</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Display boolean information that can be used to modify the policy for the 'selected domain'.</property>
+                        <property name="xalign">0.5</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">False</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="files_button">
+                        <property name="label" translatable="yes">Files</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Display file type information that can be used by the 'selected domain'.</property>
+                        <property name="xalign">0.5</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="network_button">
+                        <property name="label" translatable="yes">Network</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Display network ports to which the 'selected domain' can connect or listen to.</property>
+                        <property name="xalign">0.5</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="Transitions_button">
+                        <property name="label" translatable="yes">Transitions</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Display applications that can transition into or out of the 'selected domain'.</property>
+                        <property name="xalign">0.5</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="Login_button">
+                        <property name="label" translatable="yes">Login Mapping</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Manage the SELinux configuration</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">5</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="User_button">
+                        <property name="label" translatable="yes">SELinux Users</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Manage the SELinux configuration</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">6</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="System_button">
+                        <property name="label" translatable="yes">System</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Manage the SELinux configuration</property>
+                        <property name="xalign">0.5</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">7</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="Lockdown_button">
+                        <property name="label" translatable="yes">Lockdown</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Lockdown the SELinux System.
+This screen can be used to turn up the SELinux Protections.</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                        <signal name="toggled" handler="on_button_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">8</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="file_equiv_button">
+                        <property name="label" translatable="yes">radiobutton</property>
+                        <property name="can_focus">False</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">False</property>
+                        <property name="group">Booleans_button</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">9</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkEventBox" id="eventbox1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <signal name="button-press-event" handler="on_info_button_button_press_event" swapped="no"/>
+                        <child>
+                          <object class="GtkImage" id="info_button">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xpad">10</property>
+                            <property name="stock">gtk-help</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">11</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="middle_box_applications">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkBox" id="filter_box">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="border_width">3</property>
+                        <property name="orientation">vertical</property>
+                        <child>
+                          <object class="GtkBox" id="box14">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkLabel" id="text2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Filter</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkEntry" id="filter_entry">
+                                <property name="width_request">170</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">●</property>
+                                <property name="width_chars">25</property>
+                                <property name="shadow_type">none</property>
+                                <property name="primary_icon_stock">gtk-find</property>
+                                <property name="secondary_icon_activatable">False</property>
+                                <signal name="changed" handler="on_filter_changed" swapped="no"/>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="Show_modified_only_toggle">
+                                <property name="label" translatable="yes">Show Modified Only</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="on_Show_modified_only_toggled" swapped="no"/>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="box15">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkImage" id="warning_files">
+                                <property name="can_focus">False</property>
+                                <property name="stock">gtk-dialog-warning</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="mislabeled_files_label">
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Mislabeled files exist</property>
+                                <attributes>
+                                  <attribute name="foreground" value="#e43403050305"/>
+                                </attributes>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="Show_mislabeled_files">
+                            <property name="label" translatable="yes">Show mislabeled files only</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                            <signal name="toggled" handler="on_Show_mislabeled_files_toggled" swapped="no"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkNotebook" id="outer_notebook">
+                        <property name="height_request">465</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="show_tabs">False</property>
+                        <child>
+                          <object class="GtkBox" id="vbox3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkScrolledWindow" id="scrolledwindow4">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <child>
+                                  <object class="GtkTreeView" id="Boolean_treeview">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="no_show_all">True</property>
+                                    <property name="tooltip_text" translatable="yes">If-Then-Else rules written in policy that can 
+allow alternative access control.</property>
+                                    <property name="model">boolean_sort</property>
+                                    <property name="enable_search">False</property>
+                                    <property name="activate_on_single_click">True</property>
+                                    <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                    <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection1"/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="Active">
+                                        <property name="title" translatable="yes">Enabled</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_column_id">0</property>
+                                        <child>
+                                          <object class="GtkCellRendererToggle" id="activate"/>
+                                          <attributes>
+                                            <attribute name="active">0</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="Description">
+                                        <property name="resizable">True</property>
+                                        <property name="sizing">fixed</property>
+                                        <property name="min_width">240</property>
+                                        <property name="title" translatable="yes">Description</property>
+                                        <property name="expand">True</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_column_id">1</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext16">
+                                            <property name="wrap_mode">word</property>
+                                            <property name="wrap_width">360</property>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="text">1</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="more_detail_col">
+                                        <property name="sizing">fixed</property>
+                                        <property name="min_width">40</property>
+                                        <property name="clickable">True</property>
+                                        <property name="sort_column_id">3</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="More..">
+                                            <property name="font">Italic 8</property>
+                                            <property name="foreground_gdk">#00004e4e9999</property>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="text">3</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="Name">
+                                        <property name="sizing">fixed</property>
+                                        <property name="title" translatable="yes">Name</property>
+                                        <property name="expand">True</property>
+                                        <property name="clickable">True</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_indicator">True</property>
+                                        <property name="sort_column_id">2</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext11"/>
+                                          <attributes>
+                                            <attribute name="text">2</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="Booleans_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Booleans</property>
+                          </object>
+                          <packing>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="vbox5">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkNotebook" id="files_inner_notebook">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <signal name="switch-page" handler="on_button_toggled" swapped="no"/>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow1">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="Executable_files_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="no_show_all">True</property>
+                                        <property name="model">executable_files_sort</property>
+                                        <property name="enable_search">False</property>
+                                        <property name="search_column">0</property>
+                                        <property name="activate_on_single_click">True</property>
+                                        <signal name="button-press-event" handler="item_in_tree_selected" swapped="no"/>
+                                        <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                        <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection2"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col1">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">355</property>
+                                            <property name="title" translatable="yes">File Path</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                                              <attributes>
+                                                <attribute name="markup">0</attribute>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="restorecon_col">
+                                            <property name="min_width">70</property>
+                                            <property name="max_width">70</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext40">
+                                                <property name="foreground_gdk">#00004e4e9999</property>
+                                                <property name="text">Fix Label</property>
+                                                <property name="underline">single</property>
+                                              </object>
+                                              <attributes>
+                                                <attribute name="visible">3</attribute>
+                                                <attribute name="markup">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col2">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">175</property>
+                                            <property name="title" translatable="yes">SELinux File Type</property>
+                                            <property name="expand">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                                              <attributes>
+                                                <attribute name="markup">1</attribute>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="File Type">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">75</property>
+                                            <property name="title" translatable="yes">Class</property>
+                                            <property name="expand">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext4"/>
+                                              <attributes>
+                                                <attribute name="markup">2</attribute>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkEventBox" id="eventbox2">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <signal name="button-press-event" handler="on_tab_switch" swapped="no"/>
+                                    <child>
+                                      <object class="GtkLabel" id="Executable_files_tab">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="tooltip_text" translatable="yes">File path used to enter the 'selected domain'.</property>
+                                        <property name="label" translatable="yes">Executable Files</property>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow5">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="Writable_files_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="no_show_all">True</property>
+                                        <property name="model">writable_files_sort</property>
+                                        <property name="enable_search">False</property>
+                                        <property name="activate_on_single_click">True</property>
+                                        <signal name="button-press-event" handler="item_in_tree_selected" swapped="no"/>
+                                        <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                        <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection3"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col3">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">377</property>
+                                            <property name="title" translatable="yes">File Path</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext3"/>
+                                              <attributes>
+                                                <attribute name="markup">0</attribute>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn17">
+                                            <property name="min_width">70</property>
+                                            <property name="max_width">70</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="fix_label">
+                                                <property name="foreground_gdk">#00004e4e9999</property>
+                                                <property name="text">Fix Label</property>
+                                                <property name="underline">single</property>
+                                              </object>
+                                              <attributes>
+                                                <attribute name="visible">3</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col6">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">163</property>
+                                            <property name="title" translatable="yes">SELinux File Type</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext6"/>
+                                              <attributes>
+                                                <attribute name="markup">1</attribute>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn6">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">92</property>
+                                            <property name="title" translatable="yes">Class</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext15"/>
+                                              <attributes>
+                                                <attribute name="markup">2</attribute>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkEventBox" id="eventbox3">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <signal name="button-press-event" handler="on_tab_switch" swapped="no"/>
+                                    <child>
+                                      <object class="GtkLabel" id="Writable_files_tab">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="tooltip_text" translatable="yes">Files to which the 'selected domain' can write.</property>
+                                        <property name="label" translatable="yes">Writable files</property>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow2">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="Application_files_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="no_show_all">True</property>
+                                        <property name="model">application_files_sort</property>
+                                        <property name="enable_search">False</property>
+                                        <property name="search_column">0</property>
+                                        <property name="activate_on_single_click">True</property>
+                                        <signal name="button-press-event" handler="item_in_tree_selected" swapped="no"/>
+                                        <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                        <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection4"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col7">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">215</property>
+                                            <property name="title" translatable="yes">File Path</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext7">
+                                                <property name="yalign">0</property>
+                                              </object>
+                                              <attributes>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn18">
+                                            <property name="min_width">70</property>
+                                            <property name="max_width">70</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext42">
+                                                <property name="foreground_gdk">#00004e4e9999</property>
+                                                <property name="text">Fix Label</property>
+                                                <property name="underline">single</property>
+                                              </object>
+                                              <attributes>
+                                                <attribute name="visible">3</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col8">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">315</property>
+                                            <property name="title" translatable="yes">Description</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext8">
+                                                <property name="wrap_mode">word-char</property>
+                                                <property name="wrap_width">305</property>
+                                              </object>
+                                              <attributes>
+                                                <attribute name="markup">1</attribute>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn8">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="min_width">75</property>
+                                            <property name="title" translatable="yes">Class</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext17">
+                                                <property name="yalign">0</property>
+                                              </object>
+                                              <attributes>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkEventBox" id="eventbox4">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <signal name="button-press-event" handler="on_tab_switch" swapped="no"/>
+                                    <child>
+                                      <object class="GtkLabel" id="Application_files_tab">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="tooltip_text" translatable="yes">File Types defined for the 'selected domain'.</property>
+                                        <property name="label" translatable="yes">Application File Types</property>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">2</property>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="files_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Files</property>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="vbox6">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkNotebook" id="network_inner_notebook">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <signal name="switch-page" handler="on_button_toggled" swapped="no"/>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow3">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="outbound_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="no_show_all">True</property>
+                                        <property name="model">network_out_sort</property>
+                                        <property name="enable_search">False</property>
+                                        <property name="search_column">0</property>
+                                        <property name="fixed_height_mode">True</property>
+                                        <property name="tooltip_column">0</property>
+                                        <property name="activate_on_single_click">True</property>
+                                        <signal name="button-press-event" handler="item_in_tree_selected" swapped="no"/>
+                                        <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                        <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection5"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col19">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="title" translatable="yes">Port</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_indicator">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext29"/>
+                                              <attributes>
+                                                <attribute name="markup">0</attribute>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col20">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="title" translatable="yes">Protocol</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext30"/>
+                                              <attributes>
+                                                <attribute name="markup">1</attribute>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="title" translatable="yes">SELinux Port Type</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_indicator">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext9"/>
+                                              <attributes>
+                                                <attribute name="markup">2</attribute>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkEventBox" id="eventbox14">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <signal name="button-press-event" handler="on_tab_switch" swapped="no"/>
+                                    <child>
+                                      <object class="GtkLabel" id="network_out_tab">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="tooltip_text" translatable="yes">Network Ports to which the 'selected domain' is allowed to connect.</property>
+                                        <property name="label" translatable="yes">Outbound</property>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow7">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="inbound_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="no_show_all">True</property>
+                                        <property name="model">network_in_sort</property>
+                                        <property name="enable_search">False</property>
+                                        <property name="search_column">0</property>
+                                        <property name="fixed_height_mode">True</property>
+                                        <property name="tooltip_column">0</property>
+                                        <property name="activate_on_single_click">True</property>
+                                        <signal name="button-press-event" handler="item_in_tree_selected" swapped="no"/>
+                                        <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                        <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection6"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col21">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="title" translatable="yes">Port</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext31"/>
+                                              <attributes>
+                                                <attribute name="markup">0</attribute>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="col22">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="title" translatable="yes">Protocol</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext32"/>
+                                              <attributes>
+                                                <attribute name="markup">1</attribute>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn5">
+                                            <property name="resizable">True</property>
+                                            <property name="sizing">fixed</property>
+                                            <property name="title" translatable="yes">SELinux Port Type</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext13"/>
+                                              <attributes>
+                                                <attribute name="markup">2</attribute>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkEventBox" id="eventbox44">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <signal name="button-press-event" handler="on_tab_switch" swapped="no"/>
+                                    <child>
+                                      <object class="GtkLabel" id="network_in_tab">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="tooltip_text" translatable="yes">Network Ports to which the 'selected domain' is allowed to listen.</property>
+                                        <property name="label" translatable="yes">Inbound</property>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="Network_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Network</property>
+                          </object>
+                          <packing>
+                            <property name="position">2</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="vbox7">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkNotebook" id="transitions_inner_notebook">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <signal name="switch-page" handler="on_button_toggled" swapped="no"/>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow6">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="transitions_from_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="model">transitions_from_sort</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="enable_search">False</property>
+                                        <property name="activate_on_single_click">True</property>
+                                        <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection7"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="active_from">
+                                            <property name="resizable">True</property>
+                                            <property name="title" translatable="yes">Boolean 
+Enabled</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext25"/>
+                                              <attributes>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn27">
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext34"/>
+                                              <attributes>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="executable_file_from">
+                                            <property name="resizable">True</property>
+                                            <property name="title" translatable="yes">Boolean name</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext19"/>
+                                              <attributes>
+                                                <attribute name="markup">2</attribute>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                                            <property name="resizable">True</property>
+                                            <property name="title" translatable="yes">SELinux Application Type</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext10"/>
+                                              <attributes>
+                                                <attribute name="text">3</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkLabel" id="Transitions_from_tab">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="tooltip_text" translatable="yes">Executables which will transition to a different domain, when the 'selected domain' executes them.</property>
+                                    <property name="xpad">1</property>
+                                    <property name="ypad">1</property>
+                                    <property name="label" translatable="yes">Applicaton Transitions From 'select domain'</property>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow8">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="transitions_into_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="model">transitions_into_sort</property>
+                                        <property name="enable_search">False</property>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection8"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="active_to">
+                                            <property name="resizable">True</property>
+                                            <property name="title" translatable="yes">Boolean
+Enabled</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext24"/>
+                                              <attributes>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="Source">
+                                            <property name="resizable">True</property>
+                                            <property name="title" translatable="yes">Calling Process Domain</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext18"/>
+                                              <attributes>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="executable_file_to">
+                                            <property name="resizable">True</property>
+                                            <property name="title" translatable="yes">Executable File</property>
+                                            <property name="expand">True</property>
+                                            <property name="clickable">True</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext21"/>
+                                              <attributes>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkLabel" id="Transitions_into_tab">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="tooltip_text" translatable="yes">Executables which will transition to the 'selected domain', when executing a selected domains entrypoint.</property>
+                                    <property name="label" translatable="yes">Application Transitions Into 'select domain'</property>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkScrolledWindow" id="scrolledwindow9">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child>
+                                      <object class="GtkTreeView" id="file_transitions_treeview">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="tooltip_text" translatable="yes">File Transitions define what happens when the current domain creates the content of a particular class in a directory of the destination type. Optionally a file name could be specified for the transition.</property>
+                                        <property name="model">file_transitions_sort</property>
+                                        <property name="enable_search">False</property>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection9"/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn7">
+                                            <property name="title" translatable="yes">SELinux Directory Type</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">0</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext43"/>
+                                              <attributes>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn9">
+                                            <property name="title" translatable="yes">Destination Class</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_order">descending</property>
+                                            <property name="sort_column_id">1</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext44"/>
+                                              <attributes>
+                                                <attribute name="text">1</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn23">
+                                            <property name="title" translatable="yes">SELinux Destination Type</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">2</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext45"/>
+                                              <attributes>
+                                                <attribute name="text">2</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn24">
+                                            <property name="title" translatable="yes">File Name</property>
+                                            <property name="reorderable">True</property>
+                                            <property name="sort_column_id">3</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext46"/>
+                                              <attributes>
+                                                <attribute name="text">3</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child type="tab">
+                                  <object class="GtkLabel" id="file_transitions">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">File Transitions From 'select domain'</property>
+                                  </object>
+                                  <packing>
+                                    <property name="position">2</property>
+                                    <property name="tab_fill">False</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="Transitions_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Transitions</property>
+                          </object>
+                          <packing>
+                            <property name="position">3</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="box18">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkScrolledWindow" id="scrolledwindow17">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="shadow_type">in</property>
+                                <child>
+                                  <object class="GtkTreeView" id="login_treeview">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="no_show_all">True</property>
+                                    <property name="model">login_sort</property>
+                                    <property name="enable_search">False</property>
+                                    <property name="search_column">0</property>
+                                    <property name="activate_on_single_click">True</property>
+                                    <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                    <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection10"/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="Login Name">
+                                        <property name="resizable">True</property>
+                                        <property name="sizing">fixed</property>
+                                        <property name="title" translatable="yes">Login Name</property>
+                                        <property name="expand">True</property>
+                                        <property name="clickable">True</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_column_id">0</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext22"/>
+                                          <attributes>
+                                            <attribute name="markup">0</attribute>
+                                            <attribute name="text">0</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="SELinuxUser">
+                                        <property name="resizable">True</property>
+                                        <property name="sizing">fixed</property>
+                                        <property name="title" translatable="yes">SELinux User</property>
+                                        <property name="expand">True</property>
+                                        <property name="clickable">True</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_indicator">True</property>
+                                        <property name="sort_column_id">1</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext41"/>
+                                          <attributes>
+                                            <attribute name="markup">1</attribute>
+                                            <attribute name="text">1</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="MLS Range">
+                                        <property name="resizable">True</property>
+                                        <property name="title" translatable="yes">MLS Range</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_column_id">2</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext52"/>
+                                          <attributes>
+                                            <attribute name="markup">2</attribute>
+                                            <attribute name="text">2</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">4</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="login_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Login Mapping</property>
+                          </object>
+                          <packing>
+                            <property name="position">4</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="box21">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkScrolledWindow" id="scrolledwindow16">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="shadow_type">in</property>
+                                <child>
+                                  <object class="GtkTreeView" id="user_treeview">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="no_show_all">True</property>
+                                    <property name="tooltip_text" translatable="yes">If-Then-Else rules written in policy that can 
+allow alternative access control.</property>
+                                    <property name="model">user_sort</property>
+                                    <property name="reorderable">True</property>
+                                    <property name="enable_search">False</property>
+                                    <property name="search_column">0</property>
+                                    <property name="activate_on_single_click">True</property>
+                                    <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                    <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection11"/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="SELinuxUser Name">
+                                        <property name="resizable">True</property>
+                                        <property name="min_width">240</property>
+                                        <property name="title" translatable="yes">SELinux User</property>
+                                        <property name="expand">True</property>
+                                        <property name="clickable">True</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_column_id">0</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext48">
+                                            <property name="wrap_mode">word</property>
+                                            <property name="wrap_width">360</property>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="markup">0</attribute>
+                                            <attribute name="text">0</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="SELinuxRoles1">
+                                        <property name="resizable">True</property>
+                                        <property name="title" translatable="yes">SELinux Roles</property>
+                                        <property name="expand">True</property>
+                                        <property name="clickable">True</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_indicator">True</property>
+                                        <property name="sort_column_id">1</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext49"/>
+                                          <attributes>
+                                            <attribute name="markup">1</attribute>
+                                            <attribute name="text">1</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="DEFAULT Level">
+                                        <property name="title" translatable="yes">Default Level</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_indicator">True</property>
+                                        <property name="sort_column_id">2</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext53"/>
+                                          <attributes>
+                                            <attribute name="markup">2</attribute>
+                                            <attribute name="text">2</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn26">
+                                        <property name="resizable">True</property>
+                                        <property name="title" translatable="yes">MLS Range</property>
+                                        <property name="reorderable">True</property>
+                                        <property name="sort_indicator">True</property>
+                                        <property name="sort_column_id">3</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext54"/>
+                                          <attributes>
+                                            <attribute name="markup">3</attribute>
+                                            <attribute name="text">3</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">5</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="users_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">SELinux Users</property>
+                          </object>
+                          <packing>
+                            <property name="position">5</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="system_box">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="halign">start</property>
+                            <property name="hexpand">False</property>
+                            <property name="vexpand">False</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkFrame" id="System_mode_frame">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="valign">center</property>
+                                <property name="border_width">10</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">out</property>
+                                <child>
+                                  <object class="GtkBox" id="box6">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="halign">start</property>
+                                    <child>
+                                      <object class="GtkTable" id="grid1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">center</property>
+                                        <property name="valign">center</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label18">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0.05000000074505806</property>
+                                            <property name="label" translatable="yes">Select the system mode when the system first boots up</property>
+                                          </object>
+                                          <packing>
+                                            <property name="x_padding">15</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkBox" id="box7">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkRadioButton" id="Enforcing_button_default">
+                                                <property name="label" translatable="yes">Enforcing</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="margin_left">50</property>
+                                                <property name="xalign">0</property>
+                                                <property name="active">True</property>
+                                                <property name="draw_indicator">True</property>
+                                                <signal name="group-changed" handler="gtk_main_quit" swapped="no"/>
+                                                <signal name="toggled" handler="on_Enforcing_button_default_toggled" swapped="no"/>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkRadioButton" id="Permissive_button_default">
+                                                <property name="label" translatable="yes">Permissive</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="draw_indicator">True</property>
+                                                <property name="group">Enforcing_button_default</property>
+                                                <signal name="toggled" handler="on_Permissive_button_default_toggled" swapped="no"/>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkRadioButton" id="Disabled_button_default">
+                                                <property name="label" translatable="yes">Disabled</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="draw_indicator">True</property>
+                                                <property name="group">Enforcing_button_default</property>
+                                                <signal name="toggled" handler="on_Disabled_button_default_toggled" swapped="no"/>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">2</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">1</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="Enforcing_label">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0.0099999997764825821</property>
+                                            <property name="label" translatable="yes">Select the system mode for the current session</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">2</property>
+                                            <property name="x_padding">15</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkBox" id="box8">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkRadioButton" id="Enforcing_button">
+                                                <property name="label" translatable="yes">Enforcing</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="margin_left">50</property>
+                                                <property name="xalign">0</property>
+                                                <property name="active">True</property>
+                                                <property name="draw_indicator">True</property>
+                                                <signal name="toggled" handler="on_Enforcing_button_toggled" swapped="no"/>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkRadioButton" id="Permissive_button">
+                                                <property name="label" translatable="yes">Permissive</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="draw_indicator">True</property>
+                                                <property name="group">Enforcing_button</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">3</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="advanced_system">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">Advanced &gt;&gt;</property>
+                                            <property name="selectable">True</property>
+                                            <property name="ellipsize">end</property>
+                                            <attributes>
+                                              <attribute name="foreground" value="#00004e4e9999"/>
+                                            </attributes>
+                                            <signal name="button-press-event" handler="on_advanced_system_button_press_event" swapped="no"/>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">4</property>
+                                            <property name="x_padding">15</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkBox" id="box10">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="orientation">vertical</property>
+                                            <child>
+                                              <object class="GtkLabel" id="system_policy_type_label">
+                                                <property name="can_focus">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="label" translatable="yes">System Policy Type:</property>
+                                                <property name="width_chars">15</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkComboBox" id="system_policy_type_combobox">
+                                                <property name="width_request">200</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="margin_left">10</property>
+                                                <property name="model">system_policy_type_liststore</property>
+                                                <signal name="changed" handler="on_system_policy_type_combobox_changed" swapped="no"/>
+                                                <child>
+                                                  <object class="GtkCellRendererText" id="cellrenderertext20"/>
+                                                  <attributes>
+                                                    <attribute name="text">0</attribute>
+                                                  </attributes>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">5</property>
+                                            <property name="x_padding">15</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="info_text">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="use_markup">True</property>
+                                        <property name="wrap">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="label">
+                                  <object class="GtkLabel" id="label12">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">&lt;b&gt;System Mode&lt;/b&gt;</property>
+                                    <property name="use_markup">True</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">10</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkFrame" id="System_configuration_frame">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="valign">center</property>
+                                <property name="border_width">10</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">out</property>
+                                <child>
+                                  <object class="GtkBox" id="box13">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="halign">start</property>
+                                    <child>
+                                      <object class="GtkTable" id="grid2">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">center</property>
+                                        <property name="valign">center</property>
+                                        <property name="n_rows">4</property>
+                                        <property name="n_columns">2</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label10">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">Import system settings from another machine</property>
+                                          </object>
+                                          <packing>
+                                            <property name="x_padding">15</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkButton" id="Import_button">
+                                            <property name="label" translatable="yes">Import</property>
+                                            <property name="width_request">65</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <signal name="clicked" handler="on_Import_button_clicked" swapped="no"/>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                            <property name="x_padding">10</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label11">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">Export system settings to a file</property>
+                                            <property name="ellipsize">middle</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">1</property>
+                                            <property name="x_padding">15</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkButton" id="Export_button">
+                                            <property name="label" translatable="yes">Export</property>
+                                            <property name="width_request">65</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <signal name="clicked" handler="on_Export_button_clicked" swapped="no"/>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="top_attach">1</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                            <property name="x_padding">10</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label13">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">Relabel all files back to system defaults on reboot</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">3</property>
+                                            <property name="x_padding">15</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkSeparator" id="separator1">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
+                                            <property name="y_padding">5</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkSeparator" id="separator2">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
+                                            <property name="y_padding">5</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkBox" id="box5">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkRadioButton" id="Relabel_button">
+                                                <property name="label" translatable="yes">Yes</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="active">True</property>
+                                                <property name="draw_indicator">True</property>
+                                                <signal name="toggled" handler="on_Relabel_button_toggled_cb" swapped="no"/>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkRadioButton" id="Relabel_button_no">
+                                                <property name="label" translatable="yes">No</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="draw_indicator">True</property>
+                                                <property name="group">Relabel_button</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                            <property name="x_padding">10</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="label">
+                                  <object class="GtkLabel" id="label9">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">&lt;b&gt;System Configuration&lt;/b&gt;</property>
+                                    <property name="use_markup">True</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">6</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="systems_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">System</property>
+                          </object>
+                          <packing>
+                            <property name="position">6</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkGrid" id="grid3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkFrame" id="frame1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">none</property>
+                                <child>
+                                  <object class="GtkBox" id="box16">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <object class="GtkRadioButton" id="disable_unconfined">
+                                        <property name="label" translatable="yes">Yes</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text" translatable="yes">An unconfined domain is a process label that allows the process to do what it wants, without SELinux interfering.  Applications started at boot by the init system that SELinux do not have defined SELinux policy will run as unconfined if this module is enabled.  Disabling it means all daemons will now be confined.  To disable the unconfined_t user you must first remove unconfined_t from the users/login screens.</property>
+                                        <property name="xalign">0</property>
+                                        <property name="active">True</property>
+                                        <property name="draw_indicator">True</property>
+                                        <property name="group">enable_unconfined</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkRadioButton" id="enable_unconfined">
+                                        <property name="label" translatable="yes">No</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text" translatable="yes">An unconfined domain is a process label that allows the process to do what it wants, without SELinux interfering.  Applications started at boot by the init system that SELinux do not have defined SELinux policy will run as unconfined if this module is enabled.  Disabling it means all daemons will now be confined.  To disable the unconfined_t user you must first remove unconfined_t from the users/login screens.</property>
+                                        <property name="xalign">0</property>
+                                        <property name="active">True</property>
+                                        <property name="draw_indicator">True</property>
+                                        <signal name="toggled" handler="on_enable_unconfined_toggled" swapped="no"/>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="label">
+                                  <object class="GtkLabel" id="label19">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">&lt;b&gt;Disable ability to run unconfined system processes?&lt;/b&gt;</property>
+                                    <property name="use_markup">True</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">0</property>
+                                <property name="width">1</property>
+                                <property name="height">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkFrame" id="frame2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">none</property>
+                                <child>
+                                  <object class="GtkBox" id="box17">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <object class="GtkRadioButton" id="disable_permissive">
+                                        <property name="label" translatable="yes">Yes</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text" translatable="yes">An permissive domain is a process label that allows the process to do what it wants, with SELinux only logging the denials, but not enforcing them.  Usually permissive domains indicate experimental policy, disabling the module could cause SELinux to deny access to a domain, that should be allowed.</property>
+                                        <property name="xalign">0</property>
+                                        <property name="draw_indicator">True</property>
+                                        <property name="group">enable_permissive</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkRadioButton" id="enable_permissive">
+                                        <property name="label" translatable="yes">No</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text" translatable="yes">An permissive domain is a process label that allows the process to do what it wants, with SELinux only logging the denials, but not enforcing them.  Usually permissive domains indicate experimental policy, disabling the module could cause SELinux to deny access to a domain, that should be allowed.</property>
+                                        <property name="xalign">0</property>
+                                        <property name="active">True</property>
+                                        <property name="draw_indicator">True</property>
+                                        <signal name="toggled" handler="on_enable_permissive_toggled" swapped="no"/>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="label">
+                                  <object class="GtkLabel" id="label22">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">&lt;b&gt;Disable all permissive processes?&lt;/b&gt;</property>
+                                    <property name="use_markup">True</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">1</property>
+                                <property name="width">1</property>
+                                <property name="height">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkFrame" id="frame3">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">none</property>
+                                <child>
+                                  <object class="GtkBox" id="box1">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <object class="GtkRadioButton" id="disable_ptrace">
+                                        <property name="label" translatable="yes">Yes</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text" translatable="yes">A permissive domain is a process label that allows the process to do what it wants, with SELinux only logging the denials, but not enforcing them.  Usually permissive domains indicate experimental policy, disabling the module could cause SELinux to deny access to a domain, that should be allowed.</property>
+                                        <property name="xalign">0</property>
+                                        <property name="draw_indicator">True</property>
+                                        <signal name="toggled" handler="on_disable_ptrace_toggled" swapped="no"/>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkRadioButton" id="enable_ptrace">
+                                        <property name="label" translatable="yes">No</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text" translatable="yes">An permissive domain is a process label that allows the process to do what it wants, with SELinux only logging the denials, but not enforcing them.  Usually permissive domains indicate experimental policy, disabling the module could cause SELinux to deny access to a domain, that should be allowed.</property>
+                                        <property name="xalign">0</property>
+                                        <property name="active">True</property>
+                                        <property name="draw_indicator">True</property>
+                                        <property name="group">disable_ptrace</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="label">
+                                  <object class="GtkLabel" id="label27">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">&lt;b&gt;Deny all processes from ptracing or debugging other processes?&lt;/b&gt;</property>
+                                    <property name="use_markup">True</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">2</property>
+                                <property name="width">1</property>
+                                <property name="height">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">6</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="lockdown_tab">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Lockdown</property>
+                          </object>
+                          <packing>
+                            <property name="position">7</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkScrolledWindow" id="scrolledwindow15">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="shadow_type">in</property>
+                            <child>
+                              <object class="GtkTreeView" id="file_equiv_treeview">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="tooltip_text" translatable="yes">File equivalence cause the system to label content under the new path as if it were under the equivalence path.</property>
+                                <property name="model">file_equiv_sort</property>
+                                <property name="reorderable">True</property>
+                                <property name="enable_search">False</property>
+                                <property name="tooltip_column">0</property>
+                                <property name="activate_on_single_click">True</property>
+                                <signal name="cursor-changed" handler="on_treeview_cursor_changed" swapped="no"/>
+                                <signal name="row-activated" handler="on_column_clicked" swapped="no"/>
+                                <child internal-child="selection">
+                                  <object class="GtkTreeSelection" id="treeview-selection13"/>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="file_equiv_source">
+                                    <property name="resizable">True</property>
+                                    <property name="title" translatable="yes">Path</property>
+                                    <property name="clickable">True</property>
+                                    <property name="reorderable">True</property>
+                                    <property name="sort_indicator">True</property>
+                                    <property name="sort_column_id">0</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="cellrenderertext55"/>
+                                      <attributes>
+                                        <attribute name="markup">0</attribute>
+                                        <attribute name="text">0</attribute>
+                                      </attributes>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="treeviewcolumn25">
+                                    <property name="resizable">True</property>
+                                    <property name="title" translatable="yes">Equivalence Path</property>
+                                    <property name="clickable">True</property>
+                                    <property name="reorderable">True</property>
+                                    <property name="sort_indicator">True</property>
+                                    <property name="sort_column_id">1</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="cellrenderertext56"/>
+                                      <attributes>
+                                        <attribute name="markup">1</attribute>
+                                        <attribute name="text">1</attribute>
+                                      </attributes>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">8</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="files_equiv">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Files Equivalence</property>
+                          </object>
+                          <packing>
+                            <property name="position">8</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="init_label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0.20999999344348907</property>
+                            <property name="yalign">0.11999999731779099</property>
+                            <property name="label" translatable="yes">&lt;b&gt;...SELECT TO VIEW DATA...&lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                          </object>
+                          <packing>
+                            <property name="position">9</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="Blank_page">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="lines">0</property>
+                          </object>
+                          <packing>
+                            <property name="position">9</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkBox" id="add_modify_delete_box">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkButton" id="Delete_button">
+                            <property name="label" translatable="yes">Delete</property>
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <signal name="clicked" handler="on_Delete_button_clicked" swapped="no"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="pack_type">end</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="Modify_button">
+                            <property name="label" translatable="yes">Modify</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <signal name="clicked" handler="on_Modify_button_clicked" swapped="no"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="pack_type">end</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="Add_button">
+                            <property name="label" translatable="yes">Add</property>
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <signal name="clicked" handler="on_Add_button_clicked" swapped="no"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="pack_type">end</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkSeparator" id="separator3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="padding">4</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="lower_box_applications">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkButton" id="Revert_button">
+                        <property name="label" translatable="yes">Revert</property>
+                        <property name="visible">True</property>
+                        <property name="sensitive">False</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="tooltip_text" translatable="yes">Revert button will launch a dialog window which allows you to revert changes within the current transaction.</property>
+                        <signal name="clicked" handler="on_Revert_button_clicked" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="Update_button">
+                        <property name="label" translatable="yes">Update</property>
+                        <property name="visible">True</property>
+                        <property name="sensitive">False</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="tooltip_text" translatable="yes">Commit all changes in your current transaction to the server.</property>
+                        <signal name="clicked" handler="on_Update_button_clicked" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkStatusbar" id="status_bar">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">2</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="advanced_search_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Applications - Advanced Search</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">600</property>
+    <property name="default_height">620</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox19">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkBox" id="hbox20">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="border_width">0</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkEntry" id="advanced_filter_entry">
+                <property name="width_request">210</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_stock">gtk-find</property>
+                <property name="secondary_icon_activatable">False</property>
+                <signal name="changed" handler="on_advanced_filter_entry_changed" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="padding">10</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="All_advanced_button">
+                <property name="label" translatable="yes">All</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="xalign">0.5</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+                <signal name="toggled" handler="on_All_advanced_button_toggled" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="Installed_advanced_button">
+                <property name="label" translatable="yes">Installed</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="xalign">0.5</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">All_advanced_button</property>
+                <signal name="toggled" handler="on_Installed_advanced_button_toggled" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow11">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkTreeView" id="advanced_search_treeview">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="model">advanced_sort</property>
+                <property name="enable_search">False</property>
+                <signal name="row-activated" handler="on_advanced_search_treeview_row_activated" swapped="no"/>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection15"/>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="treeviewcolumn14">
+                    <property name="title" translatable="yes">Applications</property>
+                    <property name="expand">True</property>
+                    <property name="reorderable">True</property>
+                    <property name="sort_column_id">0</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext38"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="treeviewcolumn15">
+                    <property name="title" translatable="yes">Process Types</property>
+                    <property name="expand">True</property>
+                    <property name="reorderable">True</property>
+                    <property name="sort_column_id">1</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext39"/>
+                      <attributes>
+                        <attribute name="text">1</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="Select_advanced_search">
+            <property name="label" translatable="yes">Select</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <signal name="clicked" handler="on_Select_advanced_search_clicked" swapped="no"/>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="booleans_more_detail_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">More Details</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">650</property>
+    <property name="default_height">420</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkScrolledWindow" id="scrolledwindow13">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="shadow_type">in</property>
+        <child>
+          <object class="GtkTreeView" id="booleans_more_detail_treeview">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="model">booleans_more_detail_liststore</property>
+            <child internal-child="selection">
+              <object class="GtkTreeSelection" id="treeview-selection18"/>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="more_detail1">
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext47"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="files_delete_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Delete Modified File Labeling</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">450</property>
+    <property name="default_height">320</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox8">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="label4">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Select file labeling to delete. File labeling will be deleted when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTreeView" id="files_delete_treeview">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="model">files_delete_liststore</property>
+            <child internal-child="selection">
+              <object class="GtkTreeSelection" id="treeview-selection20"/>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="Select">
+                <property name="min_width">20</property>
+                <property name="title" translatable="yes">Select</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererToggle" id="files_toggle_delete"/>
+                  <attributes>
+                    <attribute name="active">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+                <property name="min_width">275</property>
+                <property name="title" translatable="yes">File Path</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext12"/>
+                  <attributes>
+                    <attribute name="text">1</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn10">
+                <property name="min_width">75</property>
+                <property name="title" translatable="yes">SELinux File Label</property>
+                <property name="expand">True</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext14"/>
+                  <attributes>
+                    <attribute name="text">2</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn11">
+                <property name="min_width">25</property>
+                <property name="title" translatable="yes">Class</property>
+                <property name="expand">True</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext35"/>
+                  <attributes>
+                    <attribute name="text">3</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="hbox13">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkButton" id="save_files_delete">
+                <property name="label" translatable="yes">Save to Update</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_save_delete_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_files_delete">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="network_delete_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Delete Modified Ports</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">450</property>
+    <property name="default_height">320</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox9">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="label5">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Select ports to delete. Ports will be deleted when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTreeView" id="network_delete_treeview">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="model">network_delete_liststore</property>
+            <property name="headers_clickable">False</property>
+            <property name="search_column">0</property>
+            <child internal-child="selection">
+              <object class="GtkTreeSelection" id="treeview-selection12"/>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="Select1">
+                <property name="min_width">20</property>
+                <property name="title" translatable="yes">Select</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererToggle" id="network_toggle_delete"/>
+                  <attributes>
+                    <attribute name="active">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                <property name="min_width">275</property>
+                <property name="title" translatable="yes">Port</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext5"/>
+                  <attributes>
+                    <attribute name="markup">1</attribute>
+                    <attribute name="text">1</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn12">
+                <property name="min_width">75</property>
+                <property name="title" translatable="yes">Protocol</property>
+                <property name="expand">True</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext36"/>
+                  <attributes>
+                    <attribute name="markup">2</attribute>
+                    <attribute name="text">2</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn13">
+                <property name="min_width">25</property>
+                <property name="title" translatable="yes">SELinux Port Type</property>
+                <property name="expand">True</property>
+                <property name="clickable">True</property>
+                <property name="reorderable">True</property>
+                <property name="sort_column_id">3</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext37"/>
+                  <attributes>
+                    <attribute name="markup">3</attribute>
+                    <attribute name="text">3</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="hbox15">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="save_network_delete">
+                <property name="label" translatable="yes">Save to Update</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_save_delete_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_network_delete">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="file_equiv_delete_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Delete Modified File Labeling</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">450</property>
+    <property name="default_height">320</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox14">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="label28">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Select file equivalence labeling to delete.File equivalence labeling will be deleted when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTreeView" id="file_equiv_delete_treeview">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="model">file_equiv_delete_liststore</property>
+            <property name="search_column">0</property>
+            <child internal-child="selection">
+              <object class="GtkTreeSelection" id="treeview-selection27"/>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="Select4">
+                <property name="min_width">20</property>
+                <property name="title" translatable="yes">Select</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererToggle" id="file_equiv_toggle_delete1"/>
+                  <attributes>
+                    <attribute name="active">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn21">
+                <property name="min_width">275</property>
+                <property name="title" translatable="yes">File Path</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext58"/>
+                  <attributes>
+                    <attribute name="text">1</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn29">
+                <property name="min_width">75</property>
+                <property name="title" translatable="yes">Equivalence Path</property>
+                <property name="expand">True</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext59"/>
+                  <attributes>
+                    <attribute name="text">2</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="hbox6">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkButton" id="save_files_delete2">
+                <property name="label" translatable="yes">Save to Update</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_save_delete_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_files_delete1">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="login_delete_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Delete Modified Users Mapping.</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">450</property>
+    <property name="default_height">320</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox15">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="label29">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Select login user mapping to delete. Login user mapping will be deleted when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTreeView" id="login_delete_treeview">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="model">login_delete_liststore</property>
+            <property name="search_column">0</property>
+            <child internal-child="selection">
+              <object class="GtkTreeSelection" id="treeview-selection29"/>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="Select5">
+                <property name="min_width">20</property>
+                <property name="title" translatable="yes">Select</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererToggle" id="login_toggle_delete"/>
+                  <attributes>
+                    <attribute name="active">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn30">
+                <property name="min_width">275</property>
+                <property name="title" translatable="yes">Login name</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext60"/>
+                  <attributes>
+                    <attribute name="text">2</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn31">
+                <property name="min_width">75</property>
+                <property name="title" translatable="yes">SELinux User</property>
+                <property name="expand">True</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext61"/>
+                  <attributes>
+                    <attribute name="text">1</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="hbox7">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkButton" id="save_files_delete3">
+                <property name="label" translatable="yes">Save to Update</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_save_delete_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_files_delete3">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="moreTypes_window_files">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">More Types</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">440</property>
+    <property name="default_height">250</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="gtk_main_quit" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox26">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow12">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkTreeView" id="moreTypes_treeview_files">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="model">more_types_file_liststore</property>
+                <signal name="row-activated" handler="on_moreTypes_treeview_files_row_activated" swapped="no"/>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection23"/>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="treeviewcolumn19">
+                    <property name="title" translatable="yes">Types</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext28"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="select_type_files">
+            <property name="label" translatable="yes">Select</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <signal name="clicked" handler="on_select_type_files_clicked" swapped="no"/>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="update_window">
+    <property name="can_focus">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">650</property>
+    <property name="default_height">450</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox16">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkBox" id="box11">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkLabel" id="label8">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Review the updates you have made before committing them to the system.  To reset an item, uncheck the checkbox.  All items checked will be updated in the system when you select update.</property>
+                <property name="justify">fill</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow10">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkTreeView" id="update_treeview">
+                <property name="height_request">380</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="model">Update_treestore</property>
+                <property name="search_column">0</property>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection16"/>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="Select2">
+                    <property name="min_width">20</property>
+                    <property name="title" translatable="yes">Select</property>
+                    <property name="clickable">True</property>
+                    <child>
+                      <object class="GtkCellRendererToggle" id="toggle_update"/>
+                      <attributes>
+                        <attribute name="visible">3</attribute>
+                        <attribute name="active">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="treeviewcolumn20">
+                    <property name="min_width">275</property>
+                    <property name="title" translatable="yes">Description</property>
+                    <property name="clickable">True</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext62">
+                        <property name="wrap_mode">word</property>
+                      </object>
+                      <attributes>
+                        <attribute name="text">1</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="treeviewcolumn22">
+                    <property name="min_width">25</property>
+                    <property name="title" translatable="yes">Action</property>
+                    <property name="expand">True</property>
+                    <property name="clickable">True</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext64"/>
+                      <attributes>
+                        <attribute name="text">2</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox26">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="apply_button">
+                <property name="label" translatable="yes">Apply</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_update">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="user_delete_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Delete Modified Users Mapping.</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">450</property>
+    <property name="default_height">320</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox13">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="label26">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Select users mapping to delete.Users mapping will be deleted when update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTreeView" id="user_delete_treeview">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="model">user_delete_liststore</property>
+            <property name="search_column">0</property>
+            <child internal-child="selection">
+              <object class="GtkTreeSelection" id="treeview-selection26"/>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="Select3">
+                <property name="min_width">20</property>
+                <property name="title" translatable="yes">Select</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererToggle" id="user_toggle_delete"/>
+                  <attributes>
+                    <attribute name="active">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn16">
+                <property name="min_width">275</property>
+                <property name="title" translatable="yes">SELinux Roles</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext27"/>
+                  <attributes>
+                    <attribute name="text">2</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn28">
+                <property name="min_width">75</property>
+                <property name="title" translatable="yes">SELinux Username</property>
+                <property name="expand">True</property>
+                <property name="clickable">True</property>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext57"/>
+                  <attributes>
+                    <attribute name="text">1</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="hbox5">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkButton" id="save_files_delete1">
+                <property name="label" translatable="yes">Save to Update</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_save_delete_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_files_delete2">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkWindow" id="user_popup_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Network Port Definitions</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="transient_for">SELinux_window</property>
+    <signal name="delete-event" handler="on_cancel_popup_clicked" swapped="no"/>
+    <child>
+      <object class="GtkBox" id="vbox11">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="User_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">10</property>
+            <property name="label" translatable="yes">Add User Roles. SELinux User Roles will be created when Update is applied.</property>
+            <property name="justify">fill</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTable" id="table3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="n_rows">5</property>
+            <property name="n_columns">2</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label16">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">SELinux User Name</property>
+              </object>
+              <packing>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="user_name_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Specify a new SELinux user name.  By convention SELinux User names usually end in an _u.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label23">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">SELinux Roles</property>
+              </object>
+              <packing>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="user_mls_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">MLS Range</property>
+              </object>
+              <packing>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="user_roles_combobox">
+                <property name="width_request">360</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="model">user_roles_liststore</property>
+                <signal name="changed" handler="on_user_roles_combobox_changed" swapped="no"/>
+                <child>
+                  <object class="GtkCellRendererText" id="cellrenderertext50"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="hbox3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkButton" id="save_changes_user">
+                    <property name="label" translatable="yes">Save to update</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_save_changes_user_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="cancel_user">
+                    <property name="label" translatable="yes">Cancel</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <signal name="clicked" handler="on_cancel_popup_clicked" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="pack_type">end</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="user_mls_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Enter MLS/MCS Range for this SELinux User.
+s0-s0:c1023</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="user_mls_level_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="xpad">10</property>
+                <property name="label" translatable="yes">Default Level</property>
+              </object>
+              <packing>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="user_mls_level_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">Specify the default level that you would like this SELinux user to login with.  Defaults to s0.</property>
+                <property name="invisible_char">●</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <property name="primary_icon_tooltip_text" translatable="yes">Enter Default Level for SELinux User to login with. Default s0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkTreeModelFilter" id="user_filter">
+    <property name="child_model">user_liststore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="user_sort">
+    <property name="model">user_filter</property>
+  </object>
+  <object class="GtkTreeStore" id="writable_files_treestore">
+    <columns>
+      <!-- column-name file -->
+      <column type="gchararray"/>
+      <!-- column-name SELinux -->
+      <column type="gchararray"/>
+      <!-- column-name file1 -->
+      <column type="gchararray"/>
+      <!-- column-name Label -->
+      <column type="gboolean"/>
+      <!-- column-name Mislabled -->
+      <column type="gboolean"/>
+      <!-- column-name Cur -->
+      <column type="gchararray"/>
+      <!-- column-name Con -->
+      <column type="gchararray"/>
+      <!-- column-name Modify -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="writable_files_filter">
+    <property name="child_model">writable_files_treestore</property>
+  </object>
+  <object class="GtkTreeModelSort" id="writable_files_sort">
+    <property name="model">writable_files_filter</property>
+  </object>
+</interface>
diff --git a/policycoreutils/sepolicy/sepolicy/templates/network.py b/policycoreutils/sepolicy/sepolicy/templates/network.py
index 4499440..43feee4 100644
--- a/policycoreutils/sepolicy/sepolicy/templates/network.py
+++ b/policycoreutils/sepolicy/sepolicy/templates/network.py
@@ -578,3 +578,6 @@ interface(`corenet_relabelto_TEMPLATETYPE_server_packets',`
 	allow $1 TEMPLATETYPE_server_packet_t:packet relabelto;
 ')
 """
+
+te_rules="""
+"""
diff --git a/policycoreutils/sepolicy/sepolicy/templates/script.py b/policycoreutils/sepolicy/sepolicy/templates/script.py
index c139070..c79738b 100644
--- a/policycoreutils/sepolicy/sepolicy/templates/script.py
+++ b/policycoreutils/sepolicy/sepolicy/templates/script.py
@@ -66,14 +66,17 @@ set -x
 make -f /usr/share/selinux/devel/Makefile TEMPLATEFILE.pp || exit
 /usr/sbin/semodule -i TEMPLATEFILE.pp
 
-# Generate a man page off the installed module
-sepolicy manpage -p . -d DOMAINTYPE_t
-
+"""
+rpm="""\
 # Generate a rpm package for the newly generated policy
 
 pwd=$(pwd)
-rpmbuild --define "_sourcedir ${pwd}" --define "_specdir ${pwd}" --define "_builddir ${pwd}" --define "_srcrpmdir ${pwd}" --define "_rpmdir ${pwd}" --define "_buildrootdir ${pwd}/.build"  -ba TEMPLATETYPE_selinux.spec
+rpmbuild --define "_sourcedir ${pwd}" --define "_specdir ${pwd}" --define "_builddir ${pwd}" --define "_srcrpmdir ${pwd}" --define "_rpmdir ${pwd}" --define "_buildrootdir ${pwd}/.build"  -ba TEMPLATEFILE_selinux.spec
+"""
 
+manpage="""\
+# Generate a man page off the installed module
+sepolicy manpage -p . -d DOMAINTYPE_t
 """
 
 restorecon="""\
@@ -107,8 +110,7 @@ admin_trans="""\
 """
 
 min_login_user_default_context="""\
-if [ ! -f /etc/selinux/targeted/contexts/users/TEMPLATETYPE_u ]; then
-cat > /etc/selinux/targeted/contexts/users/TEMPLATETYPE_u << _EOF
+cat > TEMPLATETYPE_u << _EOF
 TEMPLATETYPE_r:TEMPLATETYPE_t:s0	TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:crond_t		TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:initrc_su_t		TEMPLATETYPE_r:TEMPLATETYPE_t
@@ -116,12 +118,13 @@ system_r:local_login_t		TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:remote_login_t		TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:sshd_t			TEMPLATETYPE_r:TEMPLATETYPE_t
 _EOF
+if [ ! -f /etc/selinux/targeted/contexts/users/TEMPLATETYPE_u ]; then
+   cp TEMPLATETYPE_u /etc/selinux/targeted/contexts/users/
 fi
 """
 
 x_login_user_default_context="""\
-if [ ! -f /etc/selinux/targeted/contexts/users/TEMPLATETYPE_u ]; then
-cat > /etc/selinux/targeted/contexts/users/TEMPLATETYPE_u << _EOF
+cat > TEMPLATETYPE_u << _EOF
 TEMPLATETYPE_r:TEMPLATETYPE_t	TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:crond_t		TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:initrc_su_t		TEMPLATETYPE_r:TEMPLATETYPE_t
@@ -130,5 +133,7 @@ system_r:remote_login_t		TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:sshd_t				TEMPLATETYPE_r:TEMPLATETYPE_t
 system_r:xdm_t				TEMPLATETYPE_r:TEMPLATETYPE_t
 _EOF
+if [ ! -f /etc/selinux/targeted/contexts/users/TEMPLATETYPE_u ]; then
+   cp TEMPLATETYPE_u /etc/selinux/targeted/contexts/users/
 fi
 """
diff --git a/policycoreutils/sepolicy/sepolicy/templates/spec.py b/policycoreutils/sepolicy/sepolicy/templates/spec.py
index dbddf39..d8ee42f 100644
--- a/policycoreutils/sepolicy/sepolicy/templates/spec.py
+++ b/policycoreutils/sepolicy/sepolicy/templates/spec.py
@@ -18,6 +18,7 @@ URL:		http://HOSTNAME
 Source0:	MODULENAME.pp
 Source1:	MODULENAME.if
 Source2:	DOMAINNAME_selinux.8
+Source3:	DOMAINNAME_u
 
 Requires: policycoreutils, libselinux-utils
 Requires(post): selinux-policy-base >= %{selinux_policyver}, policycoreutils
@@ -36,13 +37,16 @@ install -m 644 %{SOURCE0} %{buildroot}%{_datadir}/selinux/packages
 install -d %{buildroot}%{_datadir}/selinux/devel/include/contrib
 install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/selinux/devel/include/contrib/
 install -d %{buildroot}%{_mandir}/man8/
-install -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man8/
+install -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man8/DOMAINNAME_selinux.8
+install -d %{buildroot}/etc/selinux/targeted/contexts/users/
+install -m 644 %{SOURCE3} %{buildroot}/etc/selinux/targeted/contexts/users/DOMAINNAME_u 
 
 %post
 semodule -n -i %{_datadir}/selinux/packages/MODULENAME.pp
 if /usr/sbin/selinuxenabled ; then
     /usr/sbin/load_policy
     %relabel_files
+    /usr/sbin/semanage user -a -R DOMAINNAME_r DOMAINNAME_u
 fi;
 exit 0
 
@@ -52,6 +56,7 @@ if [ $1 -eq 0 ]; then
     if /usr/sbin/selinuxenabled ; then
        /usr/sbin/load_policy
        %relabel_files
+       /usr/sbin/semanage user -d DOMAINNAME_u
     fi;
 fi;
 exit 0
@@ -60,6 +65,7 @@ exit 0
 %attr(0600,root,root) %{_datadir}/selinux/packages/MODULENAME.pp
 %{_datadir}/selinux/devel/include/contrib/MODULENAME.if
 %{_mandir}/man8/DOMAINNAME_selinux.8.*
+/etc/selinux/targeted/contexts/users/DOMAINNAME_u 
 
 %changelog
 * TODAYSDATE YOUR NAME <YOUR@EMAILADDRESS> 1.0-1
diff --git a/policycoreutils/sepolicy/sepolicy/templates/test_module.py b/policycoreutils/sepolicy/sepolicy/templates/test_module.py
new file mode 100644
index 0000000..3a3faa6
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/templates/test_module.py
@@ -0,0 +1,119 @@
+# Copyright (C) 2007-2012 Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# policygentool is a tool for the initial generation of SELinux policy
+#
+#    This program is free software; you can redistribute it and/or
+#    modify it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation; either version 2 of
+#    the License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program; if not, write to the Free Software
+#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+#                                        02111-1307  USA
+#
+#
+
+
+#['domain', 'role', 'role_prefix', 'object_class', 'name', 'private_type', 'prefix', 'entrypoint', 'target_domain', 'terminal', 'range', 'domains', 'entry_point', 'entry_file', 'domain_prefix', 'private type', 'user_prefix', 'user_role', 'user_domain', 'object', 'type', 'source_domain', 'file_type', 'file', 'class', 'peer_domain', 'objectclass(es)', 'exception_types', 'home_type', 'object_type', 'directory_type', 'boolean', 'pty_type', 'userdomain', 'tty_type', 'tmpfs_type', 'script_file', 'filetype', 'filename', 'init_script_file', 'source_role', 'userdomain_prefix']
+
+dict_values={}
+dict_values['domain'] = 'sepolicy_domain_t'
+dict_values['domains'] = 'sepolicy_domain_t'
+dict_values['target_domain'] = 'sepolicy_target_t'
+dict_values['source_domain'] = 'sepolicy_source_t'
+dict_values['peer_domain'] = 'sepolicy_peer_t'
+dict_values['exception_types'] = 'sepolicy_exception_types_t'
+dict_values['user_domain'] = 'sepolicy_userdomain_t'
+dict_values['userdomain'] = 'sepolicy_userdomain_t'
+dict_values['bool_domain'] = 'sepolicy_bool_domain_t'
+
+dict_values['type'] = 'sepolicy_file_t'
+dict_values['file_type'] = 'sepolicy_file_t'
+dict_values['private type'] = 'sepolicy_private_file_t'
+dict_values['private_type'] = 'sepolicy_private_file_t'
+dict_values['pty_type'] = 'sepolicy_devpts_t'
+dict_values['tmpfs_type'] = 'sepolicy_tmpfs_t'
+dict_values['home_type'] = 'sepolicy_home_file_t'
+dict_values['tty_type'] = 'sepolicy_t'
+dict_values['directory_type'] = 'sepolicy_file_t'
+dict_values['object_type'] = 'sepolicy_object_t'
+
+dict_values['script_file'] = 'sepolicy_exec_t'
+dict_values['entry_point'] = 'sepolicy_exec_t'
+dict_values['file'] = 'sepolicy_file_t'
+dict_values['entry_file'] = 'sepolicy_exec_t'
+dict_values['init_script_file'] = 'sepolicy_exec_t'
+dict_values['entrypoint'] = 'sepolicy_exec_t'
+
+dict_values['role'] = 'sepolicy_r'
+dict_values['role_prefix'] = 'sepolicy'
+dict_values['user_role'] = 'sepolicy_r'
+dict_values['source_role'] = 'sepolicy_source_r'
+
+dict_values['prefix'] = 'sepolicy_domain'
+dict_values['domain_prefix'] = 'sepolicy_domain'
+dict_values['userdomain_prefix'] = 'sepolicy_userdomain'
+dict_values['user_prefix'] = 'sepolicy_userdomain'
+
+dict_values['object_class'] = 'file'
+dict_values['object'] = 'file'
+dict_values['class'] = 'file'
+dict_values['objectclass(es)'] = 'file'
+dict_values['object_name'] = 'sepolicy_object'
+dict_values['name'] = '"sepolicy_name"'
+
+dict_values['terminal'] = 'sepolicy_tty_t'
+dict_values['boolean'] = 'sepolicy_bool_t'
+dict_values['range'] = 's0 - mcs_systemhigh'
+
+te_test_module="""\
+policy_module(TEMPLATETYPE, 1.0.0)
+
+type sepolicy_t;
+domain_type(sepolicy_t)
+type sepolicy_domain_t;
+domain_type(sepolicy_domain_t)
+type sepolicy_target_t;
+domain_type(sepolicy_target_t)
+type sepolicy_source_t;
+domain_type(sepolicy_source_t)
+type sepolicy_peer_t;
+domain_type(sepolicy_peer_t)
+type sepolicy_exception_types_t;
+domain_type(sepolicy_exception_types_t)
+type sepolicy_userdomain_t;
+domain_type(sepolicy_userdomain_t)
+
+type sepolicy_file_t;
+files_type(sepolicy_file_t)
+type sepolicy_private_file_t;
+files_type(sepolicy_private_file_t)
+type sepolicy_home_file_t;
+files_type(sepolicy_home_file_t)
+type sepolicy_tty_t;
+term_tty(sepolicy_tty_t)
+type sepolicy_object_t;
+type sepolicy_devpts_t;
+term_pty(sepolicy_devpts_t)
+type sepolicy_tmpfs_t;
+files_type(sepolicy_tmpfs_t)
+type sepolicy_exec_t;
+files_type(sepolicy_exec_t)
+
+role sepolicy_r;
+role sepolicy_source_r;
+role sepolicy_target_r;
+
+################################# 
+#
+# Local policy
+#
+
+"""
diff --git a/policycoreutils/sepolicy/sepolicy/templates/unit_file.py b/policycoreutils/sepolicy/sepolicy/templates/unit_file.py
index 3069044..e26f5e2 100644
--- a/policycoreutils/sepolicy/sepolicy/templates/unit_file.py
+++ b/policycoreutils/sepolicy/sepolicy/templates/unit_file.py
@@ -48,7 +48,7 @@ interface(`TEMPLATETYPE_systemctl',`
 	')
 
 	systemd_exec_systemctl($1)
-        systemd_read_fifo_file_password_run($1)
+        systemd_read_fifo_file_passwd_run($1)
 	allow $1 TEMPLATETYPE_unit_file_t:file read_file_perms;
 	allow $1 TEMPLATETYPE_unit_file_t:service manage_service_perms;
 
diff --git a/policycoreutils/sepolicy/sepolicy/templates/user.py b/policycoreutils/sepolicy/sepolicy/templates/user.py
index 79f3997..1ff9d2c 100644
--- a/policycoreutils/sepolicy/sepolicy/templates/user.py
+++ b/policycoreutils/sepolicy/sepolicy/templates/user.py
@@ -71,11 +71,6 @@ policy_module(TEMPLATETYPE, 1.0.0)
 te_root_user_types="""\
 policy_module(TEMPLATETYPE, 1.0.0)
 
-########################################
-#
-# Declarations
-#
-
 ## <desc>
 ## <p>
 ## Allow TEMPLATETYPE to read files in the user home directory
@@ -90,6 +85,11 @@ gen_tunable(TEMPLATETYPE_read_user_files, false)
 ## </desc>
 gen_tunable(TEMPLATETYPE_manage_user_files, false)
 
+########################################
+#
+# Declarations
+#
+
 userdom_base_user_template(TEMPLATETYPE)
 """
 
@@ -151,7 +151,9 @@ tunable_policy(`TEMPLATETYPE_read_user_files',`
 ')
 
 tunable_policy(`TEMPLATETYPE_manage_user_files',`
-        userdom_manage_user_home_content(TEMPLATETYPE_t)
+	userdom_manage_user_home_content_dirs(TEMPLATETYPE_t)
+	userdom_manage_user_home_content_files(TEMPLATETYPE_t)
+	userdom_manage_user_home_content_symlinks(TEMPLATETYPE_t)
         userdom_manage_user_tmp_files(TEMPLATETYPE_t)
 ')
 """
diff --git a/policycoreutils/sepolicy/sepolicy/transition.py b/policycoreutils/sepolicy/sepolicy/transition.py
index 5850622..11834c7 100755
--- a/policycoreutils/sepolicy/sepolicy/transition.py
+++ b/policycoreutils/sepolicy/sepolicy/transition.py
@@ -20,10 +20,9 @@
 #                                        02111-1307  USA
 #
 #  
-import sepolicy, sys
+import sepolicy
 search=sepolicy.search
 info=sepolicy.info
-_failedlist = []
 __all__ = [ 'setrans', ]
 
 def _entrypoint(src):
@@ -32,11 +31,11 @@ def _entrypoint(src):
     
 
 def _get_trans(src):
-    foundstr = ""
     return search([sepolicy.TRANSITION],{sepolicy.SOURCE:src, sepolicy.CLASS:"process"})
 
 class setrans:
     def __init__(self, source, dest=None):
+        self.seen = []
         self.sdict = {}
         self.source=source
         self.dest=dest
@@ -58,19 +57,25 @@ class setrans:
             for s in self.sdict[source]["child"]:
                 self._process(s)
             
-    def out(self, name, seen=[], header=""):
+    def out(self, name, header=""):
         buf = ""
-        if name in seen:
+        if name in self.seen:
             return buf
-        seen.append(name)
+        self.seen.append(name)
 
-        for t in self.sdict[name]["map"]:
-            buf += "%s%s @ %s --> %s\n" % (header, t["source"], t["target"], t["transtype"])
+        if "map" in self.sdict[name]:
+            for t in self.sdict[name]["map"]:
+                cond=sepolicy.get_conditionals(t["source"], t["transtype"],"process",["transition"])
+                if cond:
+                    buf += "%s%s @ %s --> %s %s\n" % (header, t["source"], t["target"], t["transtype"], sepolicy.get_conditionals_format_text(cond))
+                else:
+                    buf += "%s%s @ %s --> %s\n" % (header, t["source"], t["target"], t["transtype"])
 
         if "child" in self.sdict[name]:
             for x in self.sdict[name]["child"]:
-                buf+= self.out(x, seen, "%s%s ... " % (header, name))
+                buf+= self.out(x, "%s%s ... " % (header, name))
         return buf
 
     def output(self):
+        self.seen = []
         print self.out(self.source)
diff --git a/policycoreutils/sepolicy/setup.py b/policycoreutils/sepolicy/setup.py
index 1edb4fd..d8e2d64 100644
--- a/policycoreutils/sepolicy/setup.py
+++ b/policycoreutils/sepolicy/setup.py
@@ -9,4 +9,4 @@ policy = Extension("sepolicy._policy",
                    sources=[ "policy.c", "info.c", "search.c"]
 )
 
-setup(name = "sepolicy", version="1.1", description="Python SELinux Policy Analyses bindings", author="Daniel Walsh", author_email="dwalsh@redhat.com", ext_modules=[policy], packages=["sepolicy", "sepolicy.templates"])
+setup(name = "sepolicy", version="1.1", description="Python SELinux Policy Analyses bindings", author="Daniel Walsh", author_email="dwalsh@redhat.com", ext_modules=[policy], packages=["sepolicy", "sepolicy.templates", "sepolicy.help"], package_data={'sepolicy':['*.glade'], 'sepolicy.help': ['*.txt', '*.png']})
-- 
1.8.3.1

