All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <lautrbach@redhat.com>
To: Pepper Gray <hello@peppergray.xyz>, selinux@vger.kernel.org
Subject: Re: [PATCH] adjust audit2why map for python2 and 3
Date: Thu, 28 May 2026 15:53:23 +0200	[thread overview]
Message-ID: <87a4tjod2k.fsf@redhat.com> (raw)
In-Reply-To: <CAHLDejxHRvHPWYK8q-VO4_OpEozY-4bKc4hSuFL6SL6o=JKw_A@mail.gmail.com>

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])
>      ],
>  )


  reply	other threads:[~2026-05-28 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07  9:52 [PATCH] adjust audit2why map for python2 and 3 Pepper Gray
2026-05-28 13:53 ` Petr Lautrbach [this message]
     [not found]   ` <CAHLDejyUiLXZBKhGFpZZxP+k3CCaTL0bPA_xhonYc6pXvOsx6A@mail.gmail.com>
2026-05-29 10:31     ` github Issues and PR Petr Lautrbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a4tjod2k.fsf@redhat.com \
    --to=lautrbach@redhat.com \
    --cc=hello@peppergray.xyz \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.