Skip to contentSkip to conversation

sepolgen fixes.

PATCH Daniel J Walsh 3 participants 3 messages Feb 20, 2007 – Feb 21, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

Change to Makefile to get proper python library path even on 64 bit
platforms.
Empty or poorly formated interface files cause sepol-ifgen to crash.

sepolgen-1.0.0/src/sepolgen/Makefile renamed from src/sepolgen/Makefile +1 -1
diff --exclude-from=exclude -N -u -r nsasepolgen/src/sepolgen/Makefile policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/Makefile
@@ -1,4 +1,4 @@
-PYTHONLIBDIR ?= `python -c "from distutils.sysconfig import *; print get_python_lib()"`
+PYTHONLIBDIR ?= $(shell  python -c "from distutils.sysconfig import *; print get_python_lib(1)")
 PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR)/sepolgen
 
 install:
sepolgen-1.0.0/src/sepolgen/refparser.py renamed from src/sepolgen/refparser.py +5 -3
diff --exclude-from=exclude -N -u -r nsasepolgen/src/sepolgen/refparser.py policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/refparser.py
@@ -691,11 +691,13 @@
             output.write(msg)
 
     def parse_file(f, module, spt=None):
-        fd = open(f)
-        txt = fd.read()
-        fd.close()
         try:
+            fd = open(f)
+            txt = fd.read()
+            fd.close()
             parse(txt, module, spt)
+        except IOError, e:
+            return
         except ValueError, e:
             raise ValueError("error parsing file %s: %s" % (f, str(e)))
 
#1 lore raw
Quoted 5 lines · Daniel J Walsh

Change to Makefile to get proper python library path even on 64 bit
platforms.
Empty or poorly formated interface files cause sepol-ifgen to crash.

Quoted 21 lines

------------------------------------------------------------------------

diff --exclude-from=exclude -N -u -r nsasepolgen/src/sepolgen/Makefile policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/Makefile

sepolgen-1.0.0/src/sepolgen/Makefile renamed from src/sepolgen/Makefile +1 -1
@@ -1,4 +1,4 @@
-PYTHONLIBDIR ?= `python -c "from distutils.sysconfig import *; print get_python_lib()"`
+PYTHONLIBDIR ?= $(shell  python -c "from distutils.sysconfig import *; print get_python_lib(1)")
 PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR)/sepolgen
 
 install:

diff --exclude-from=exclude -N -u -r nsasepolgen/src/sepolgen/refparser.py policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/refparser.py

sepolgen-1.0.0/src/sepolgen/refparser.py renamed from src/sepolgen/refparser.py +0 -3
@@ -691,11 +691,13 @@
             output.write(msg)
 
     def parse_file(f, module, spt=None):
-        fd = open(f)
-        txt = fd.read()
-        fd.close()

sepolgen-1.0.0/src/sepolgen/refparser.py line 703

Quoted 10 lines
sepolgen-1.0.0/src/sepolgen/refparser.py renamed from src/sepolgen/refparser.py +5 -0
         try:
+            fd = open(f)
+            txt = fd.read()
+            fd.close()
             parse(txt, module, spt)
+        except IOError, e:
+            return
         except ValueError, e:
             raise ValueError("error parsing file %s: %s" % (f, str(e)))
 

--
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
In reply to Daniel J Walsh
Quoted 3 lines · Daniel J Walsh

Change to Makefile to get proper python library path even on 64 bit
platforms.
Empty or poorly formated interface files cause sepol-ifgen to crash.

Thanks, merged.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
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.