All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] adjust audit2why map for python2 and 3
@ 2026-05-07  9:52 Pepper Gray
  2026-05-28 13:53 ` Petr Lautrbach
  0 siblings, 1 reply; 3+ messages in thread
From: Pepper Gray @ 2026-05-07  9:52 UTC (permalink / raw)
  To: selinux

From 3cd62189af93997ab5ff58684352af38900c7758 Mon Sep 17 00:00:00 2001
From: Pepper Gray <hello@peppergray.xyz>
Date: Sat, 11 Apr 2026 19:33:07 +0200
Subject: [PATCH] adjust audit2why map for python2 and 3

align conditional python symbols creation and export

fix: #461
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
---
 libselinux/src/audit2why-py2.map |  5 +++++
 libselinux/src/audit2why-py3.map |  5 +++++
 libselinux/src/setup.py          | 16 +++++++++++++---
 3 files changed, 23 insertions(+), 3 deletions(-)
 create mode 100644 libselinux/src/audit2why-py2.map
 create mode 100644 libselinux/src/audit2why-py3.map

diff --git a/libselinux/src/audit2why-py2.map b/libselinux/src/audit2why-py2.map
new file mode 100644
index 0000000000..249f0beb3b
--- /dev/null
+++ b/libselinux/src/audit2why-py2.map
@@ -0,0 +1,5 @@
+AUDIT2WHY_2.9 {
+  global:
+    initaudit2why;
+  local: *;
+};
diff --git a/libselinux/src/audit2why-py3.map b/libselinux/src/audit2why-py3.map
new file mode 100644
index 0000000000..e99b8d7688
--- /dev/null
+++ b/libselinux/src/audit2why-py3.map
@@ -0,0 +1,5 @@
+AUDIT2WHY_2.9 {
+  global:
+    PyInit_audit2why;
+  local: *;
+};
diff --git a/libselinux/src/setup.py b/libselinux/src/setup.py
index 679ea43f8b..9201448f0e 100644
--- a/libselinux/src/setup.py
+++ b/libselinux/src/setup.py
@@ -1,11 +1,21 @@
-#!/usr/bin/python3
+#!/usr/bin/env python

+import sys
 from setuptools import Extension, setup

+PY_MAJOR_VERSION = sys.version_info[0]
+
+if PY_MAJOR_VERSION >= 3:
+    audit2why_map = "audit2why-py3.map"
+    description = "SELinux python 3 bindings"
+else:
+    audit2why_map = "audit2why-py2.map"
+    description = "SELinux python 2 bindings"
+
 setup(
     name="selinux",
     version="3.10",
-    description="SELinux python 3 bindings",
+    description=description,
     author="SELinux Project",
     author_email="selinux@vger.kernel.org",
     ext_modules=[
@@ -19,6 +29,6 @@
                   include_dirs=['../include'],
                   library_dirs=['.'],
                   libraries=['selinux'],
-                  extra_link_args=['-l:libsepol.a',
'-Wl,--version-script=audit2why.map'])
+                  extra_link_args=['-l:libsepol.a',
"-Wl,--version-script={}".format(audit2why_map])
     ],
 )

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

* Re: [PATCH] adjust audit2why map for python2 and 3
  2026-05-07  9:52 [PATCH] adjust audit2why map for python2 and 3 Pepper Gray
@ 2026-05-28 13:53 ` Petr Lautrbach
       [not found]   ` <CAHLDejyUiLXZBKhGFpZZxP+k3CCaTL0bPA_xhonYc6pXvOsx6A@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Lautrbach @ 2026-05-28 13:53 UTC (permalink / raw)
  To: Pepper Gray, selinux

Pepper Gray <hello@peppergray.xyz> writes:

> From 3cd62189af93997ab5ff58684352af38900c7758 Mon Sep 17 00:00:00 2001
> From: Pepper Gray <hello@peppergray.xyz>
> Date: Sat, 11 Apr 2026 19:33:07 +0200
> Subject: [PATCH] adjust audit2why map for python2 and 3
>
> align conditional python symbols creation and export
>
> fix: #461
> Signed-off-by: Pepper Gray <hello@peppergray.xyz>


Please use `git send-email` to send patches next time.

Python 2 is not supported in this project since SELinux userspace release 20191204 / 3.0
Python 2 EOL was January 2020.

Petr

> ---
>  libselinux/src/audit2why-py2.map |  5 +++++
>  libselinux/src/audit2why-py3.map |  5 +++++
>  libselinux/src/setup.py          | 16 +++++++++++++---
>  3 files changed, 23 insertions(+), 3 deletions(-)
>  create mode 100644 libselinux/src/audit2why-py2.map
>  create mode 100644 libselinux/src/audit2why-py3.map
>
> diff --git a/libselinux/src/audit2why-py2.map b/libselinux/src/audit2why-py2.map
> new file mode 100644
> index 0000000000..249f0beb3b
> --- /dev/null
> +++ b/libselinux/src/audit2why-py2.map
> @@ -0,0 +1,5 @@
> +AUDIT2WHY_2.9 {
> +  global:
> +    initaudit2why;
> +  local: *;
> +};
> diff --git a/libselinux/src/audit2why-py3.map b/libselinux/src/audit2why-py3.map
> new file mode 100644
> index 0000000000..e99b8d7688
> --- /dev/null
> +++ b/libselinux/src/audit2why-py3.map
> @@ -0,0 +1,5 @@
> +AUDIT2WHY_2.9 {
> +  global:
> +    PyInit_audit2why;
> +  local: *;
> +};
> diff --git a/libselinux/src/setup.py b/libselinux/src/setup.py
> index 679ea43f8b..9201448f0e 100644
> --- a/libselinux/src/setup.py
> +++ b/libselinux/src/setup.py
> @@ -1,11 +1,21 @@
> -#!/usr/bin/python3
> +#!/usr/bin/env python
>
> +import sys
>  from setuptools import Extension, setup
>
> +PY_MAJOR_VERSION = sys.version_info[0]
> +
> +if PY_MAJOR_VERSION >= 3:
> +    audit2why_map = "audit2why-py3.map"
> +    description = "SELinux python 3 bindings"
> +else:
> +    audit2why_map = "audit2why-py2.map"
> +    description = "SELinux python 2 bindings"
> +
>  setup(
>      name="selinux",
>      version="3.10",
> -    description="SELinux python 3 bindings",
> +    description=description,
>      author="SELinux Project",
>      author_email="selinux@vger.kernel.org",
>      ext_modules=[
> @@ -19,6 +29,6 @@
>                    include_dirs=['../include'],
>                    library_dirs=['.'],
>                    libraries=['selinux'],
> -                  extra_link_args=['-l:libsepol.a',
> '-Wl,--version-script=audit2why.map'])
> +                  extra_link_args=['-l:libsepol.a',
> "-Wl,--version-script={}".format(audit2why_map])
>      ],
>  )


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

* github Issues and PR
       [not found]   ` <CAHLDejyUiLXZBKhGFpZZxP+k3CCaTL0bPA_xhonYc6pXvOsx6A@mail.gmail.com>
@ 2026-05-29 10:31     ` Petr Lautrbach
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Lautrbach @ 2026-05-29 10:31 UTC (permalink / raw)
  To: Pepper Gray, selinux

Pepper Gray <hello@peppergray.xyz> writes:

> Hi Petr,
>
...

> I will investigate how to send patches in the proper format. Please note
> that your Github is quite frustrating and consider disabling Issues and PRs
> there if nobody is gonna look at them anyways!

If a PR is opened via web page, there's this template:

    Please read [CONTRIBUTING.md](https://github.com/SELinuxProject/selinux/blob/main/CONTRIBUTING.md)
    
    
    ## Contributing Code
    
    Post the patch for the review to the
    [SELinux mailing list](https://lore.kernel.org/selinux) at
    [selinux@vger.kernel.org](mailto:selinux@vger.kernel.org).
    
    When preparing patches, please follow these guidelines:
    
    -   Patches should apply with git am
    -   Must apply against HEAD of the main branch
    -   Separate large patches into logical patches
    -   Patch descriptions must end with your "Signed-off-by" line. This means your
        code meets the Developer's certificate of origin, see below.


I guess that it's not shown when a PR is opened via some tool. Sometimes PRs
are used by the team to trigger CI or when it's not possible to send a
patch due to the size limitation on the mailing list

As for Issues, they are monitored even though not consistently.

It's clearly stated in the
https://github.com/SELinuxProject/selinux/blob/main/CONTRIBUTING.md that
bugs and patches should be sent to the mailing list.

Leaving both open should make the contribution for people using github
more accessible even trhough we don't really use it.


Petr


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

end of thread, other threads:[~2026-05-29 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07  9:52 [PATCH] adjust audit2why map for python2 and 3 Pepper Gray
2026-05-28 13:53 ` Petr Lautrbach
     [not found]   ` <CAHLDejyUiLXZBKhGFpZZxP+k3CCaTL0bPA_xhonYc6pXvOsx6A@mail.gmail.com>
2026-05-29 10:31     ` github Issues and PR Petr Lautrbach

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.