All of lore.kernel.org
 help / color / mirror / Atom feed
* sepolgen fixes.
@ 2007-02-20 14:55 Daniel J Walsh
  2007-02-21 17:14 ` Karl MacMillan
  2007-02-21 17:22 ` Stephen Smalley
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel J Walsh @ 2007-02-20 14:55 UTC (permalink / raw)
  To: Stephen Smalley, SE Linux, Karl MacMillan

[-- Attachment #1: Type: text/plain, Size: 159 bytes --]

    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. 


[-- Attachment #2: policycoreutils-sepolgen.patch --]
[-- Type: text/x-patch, Size: 1336 bytes --]

diff --exclude-from=exclude -N -u -r nsasepolgen/src/sepolgen/Makefile policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/Makefile
--- nsasepolgen/src/sepolgen/Makefile	2007-02-07 12:12:15.000000000 -0500
+++ policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/Makefile	2007-02-15 15:56:05.000000000 -0500
@@ -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
--- nsasepolgen/src/sepolgen/refparser.py	2007-02-07 12:12:15.000000000 -0500
+++ policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/refparser.py	2007-02-15 15:16:09.000000000 -0500
@@ -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)))
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sepolgen fixes.
  2007-02-20 14:55 sepolgen fixes Daniel J Walsh
@ 2007-02-21 17:14 ` Karl MacMillan
  2007-02-21 17:22 ` Stephen Smalley
  1 sibling, 0 replies; 3+ messages in thread
From: Karl MacMillan @ 2007-02-21 17:14 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: Stephen Smalley, SE Linux, Karl MacMillan

Daniel J Walsh wrote:
>    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.
> 
> 

Acked-by: Karl MacMillan <kmacmillan@mentalrootkit.com>

> ------------------------------------------------------------------------
> 
> diff --exclude-from=exclude -N -u -r nsasepolgen/src/sepolgen/Makefile policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/Makefile
> --- nsasepolgen/src/sepolgen/Makefile	2007-02-07 12:12:15.000000000 -0500
> +++ policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/Makefile	2007-02-15 15:56:05.000000000 -0500
> @@ -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
> --- nsasepolgen/src/sepolgen/refparser.py	2007-02-07 12:12:15.000000000 -0500
> +++ policycoreutils-2.0.1/sepolgen-1.0.0/src/sepolgen/refparser.py	2007-02-15 15:16:09.000000000 -0500
> @@ -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)))
>  


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sepolgen fixes.
  2007-02-20 14:55 sepolgen fixes Daniel J Walsh
  2007-02-21 17:14 ` Karl MacMillan
@ 2007-02-21 17:22 ` Stephen Smalley
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Smalley @ 2007-02-21 17:22 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: SE Linux, Karl MacMillan

On Tue, 2007-02-20 at 09:55 -0500, Daniel J Walsh wrote:
>     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.

-- 
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 majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-21 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-20 14:55 sepolgen fixes Daniel J Walsh
2007-02-21 17:14 ` Karl MacMillan
2007-02-21 17:22 ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.