diff mbox series

[v2] python/sepolicy: call segenxml.py with python3

Message ID 20191009142024.9278-1-sds@tycho.nsa.gov (mailing list archive)
State Accepted
Headers show
Series [v2] python/sepolicy: call segenxml.py with python3 | expand

Commit Message

Stephen Smalley Oct. 9, 2019, 2:20 p.m. UTC
Fixes: https://github.com/SELinuxProject/selinux/issues/61
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
v2 wraps basedir + filename in parentheses as per Nicolas Iooss' suggestion.

 python/sepolicy/sepolicy/interface.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas Iooss Oct. 10, 2019, 7:48 p.m. UTC | #1
On Wed, Oct 9, 2019 at 4:20 PM Stephen Smalley <sds@tycho.nsa.gov> wrote:
>
> Fixes: https://github.com/SELinuxProject/selinux/issues/61
> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
> ---
> v2 wraps basedir + filename in parentheses as per Nicolas Iooss' suggestion.

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

>
>  python/sepolicy/sepolicy/interface.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/python/sepolicy/sepolicy/interface.py b/python/sepolicy/sepolicy/interface.py
> index 583091ae18aa..187419fa7822 100644
> --- a/python/sepolicy/sepolicy/interface.py
> +++ b/python/sepolicy/sepolicy/interface.py
> @@ -196,7 +196,7 @@ def get_xml_file(if_file):
>          from subprocess import getstatusoutput
>      basedir = os.path.dirname(if_file) + "/"
>      filename = os.path.basename(if_file).split(".")[0]
> -    rc, output = getstatusoutput("python /usr/share/selinux/devel/include/support/segenxml.py -w -m %s" % basedir + filename)
> +    rc, output = getstatusoutput("/usr/bin/python3 /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)
> --
> 2.21.0
>
Stephen Smalley Oct. 15, 2019, 2:17 p.m. UTC | #2
On 10/10/19 3:48 PM, Nicolas Iooss wrote:
> On Wed, Oct 9, 2019 at 4:20 PM Stephen Smalley <sds@tycho.nsa.gov> wrote:
>>
>> Fixes: https://github.com/SELinuxProject/selinux/issues/61
>> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
>> ---
>> v2 wraps basedir + filename in parentheses as per Nicolas Iooss' suggestion.
> 
> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Thanks, applied.

> 
>>
>>   python/sepolicy/sepolicy/interface.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/python/sepolicy/sepolicy/interface.py b/python/sepolicy/sepolicy/interface.py
>> index 583091ae18aa..187419fa7822 100644
>> --- a/python/sepolicy/sepolicy/interface.py
>> +++ b/python/sepolicy/sepolicy/interface.py
>> @@ -196,7 +196,7 @@ def get_xml_file(if_file):
>>           from subprocess import getstatusoutput
>>       basedir = os.path.dirname(if_file) + "/"
>>       filename = os.path.basename(if_file).split(".")[0]
>> -    rc, output = getstatusoutput("python /usr/share/selinux/devel/include/support/segenxml.py -w -m %s" % basedir + filename)
>> +    rc, output = getstatusoutput("/usr/bin/python3 /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)
>> --
>> 2.21.0
>>
>
diff mbox series

Patch

diff --git a/python/sepolicy/sepolicy/interface.py b/python/sepolicy/sepolicy/interface.py
index 583091ae18aa..187419fa7822 100644
--- a/python/sepolicy/sepolicy/interface.py
+++ b/python/sepolicy/sepolicy/interface.py
@@ -196,7 +196,7 @@  def get_xml_file(if_file):
         from subprocess import getstatusoutput
     basedir = os.path.dirname(if_file) + "/"
     filename = os.path.basename(if_file).split(".")[0]
-    rc, output = getstatusoutput("python /usr/share/selinux/devel/include/support/segenxml.py -w -m %s" % basedir + filename)
+    rc, output = getstatusoutput("/usr/bin/python3 /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)