Skip to contentSkip to conversation

check for handle creation failures in seobject

PATCH In review Karl MacMillan 2 participants 4 messages Jan 5, 2007 – Jan 8, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check for handle creation failures in seobject

seobject.py assumes that handle creation always succeeds, though this is not always the case. This patch checks for that failure.

policycoreutils/semanage/seobject.py +3 -0
diff -r 4400130009b8 policycoreutils/semanage/seobject.py
@@ -208,6 +208,9 @@ class semanageRecords:
 class semanageRecords:
 	def __init__(self):
 		self.sh = semanage_handle_create()
+                if not self.sh:
+                       raise ValueError(_("Could not create semanage handle"))
+
 		self.semanaged = semanage_is_managed(self.sh)
 
 		if not self.semanaged:

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 4 lines · Karl MacMillan

seobject.py assumes that handle creation always succeeds, though this is not always the case. This patch checks for that failure.

Another try without line wrapping and with tabs instead of spaces.

policycoreutils/semanage/seobject.py +3 -0
diff -r 5e7683c788a4 policycoreutils/semanage/seobject.py
@@ -208,6 +208,9 @@ class semanageRecords:
 class semanageRecords:
 	def __init__(self):
 		self.sh = semanage_handle_create()
+		if not self.sh:
+		       raise ValueError(_("Could not create semanage handle"))
+		
 		self.semanaged = semanage_is_managed(self.sh)
 
 		if not self.semanaged:

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
Quoted 16 lines · Karl MacMillan
Quoted 4 lines · Karl MacMillan

seobject.py assumes that handle creation always succeeds, though this is not always the case. This patch checks for that failure.

Another try without line wrapping and with tabs instead of spaces.

diff -r 5e7683c788a4 policycoreutils/semanage/seobject.py
--- a/policycoreutils/semanage/seobject.py Fri Jan 05 12:05:19 2007
-0500
+++ b/policycoreutils/semanage/seobject.py Fri Jan 05 12:08:34 2007
-0500

policycoreutils/semanage/seobject.py class semanageRecords: · line 216

Quoted 9 lines
policycoreutils/semanage/seobject.py +3 -0
@@ -208,6 +208,9 @@ class semanageRecords:
 class semanageRecords:
     def __init__(self):
         self.sh = semanage_handle_create()
+        if not self.sh:
+               raise ValueError(_("Could not create semanage handle"))
+       
         self.semanaged = semanage_is_managed(self.sh)
 
         if not self.semanaged:

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#3 lore raw
In reply to Karl MacMillan
Quoted 9 lines · Karl MacMillan
Quoted 4 lines · Karl MacMillan

seobject.py assumes that handle creation always succeeds, though this is not always the case. This patch checks for that failure.

Another try without line wrapping and with tabs instead of spaces.

Merged this along with the libsemanage error code propagation and the disk reduction patches as of libsemanage 1.9.2 and policycoreutils 1.33.10

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.