Bug 280567 - security/py-kerberos: Make compatible to python3.11
Summary: security/py-kerberos: Make compatible to python3.11
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dan Langille
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-02 06:34 UTC by topical
Modified: 2025-01-19 16:24 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (dvl)


Attachments
Make py-kerberos compatible to python 3.11 (1.59 KB, text/plain)
2024-08-02 06:34 UTC, topical
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description topical 2024-08-02 06:34:43 UTC
Created attachment 252446 [details]
Make py-kerberos compatible to python 3.11

After updating to ports to 2024Q3, which defaults to python 3.11, py-kerberos doesn’t work anymore. 

The patch is based on https://github.com/apple/ccs-pykerberos/pull/89/files 

Unfortunately, the github repository of py-kerberos is in archived state, so the pull requests will never be applied upstream.

Further, I changed default options from „GSSAPI_BASE“ to „GSSAPI_MIT“. Without this, ansible hangs when using it indirectly with pywinrm.

I would be happy if the attached patch could be applied.
Comment 1 Christian Ullrich 2024-12-07 07:31:29 UTC
(In reply to topical from comment #0)

> I would be happy if the attached patch could be applied.

So would I.
Comment 2 Michael Osipov freebsd_committer freebsd_triage 2024-12-09 12:01:41 UTC
Why don't you use py-gssapi? It works fantastically.
Comment 3 Christian Ullrich 2024-12-09 12:30:52 UTC
(In reply to Michael Osipov from comment #2)

> Why don't you use py-gssapi? It works fantastically.

I'm not, others are:

https://github.com/diyan/pywinrm/blob/cbc1e3475a516e2dabfc58925ed2bcd932856ccb/pyproject.toml#L53

https://github.com/freebsd/freebsd-ports/blob/33de0c36f124805e86d12437f2d4eb5bf629cac0/security/py-pywinrm/Makefile#L17 (see also #283176; recent versions vendor requests-kerberos and instead depend directly on pykerberos)

https://github.com/freebsd/freebsd-ports/blob/33de0c36f124805e86d12437f2d4eb5bf629cac0/security/py-requests-kerberos/Makefile#L16
Comment 4 Michael Osipov freebsd_committer freebsd_triage 2024-12-09 12:37:20 UTC
(In reply to Christian Ullrich from comment #3)

I see, you can replace py-requests-kerberos with https://pypi.org/project/requests-gssapi/. It is more or less the official successor. The only issue is WinRM stuff. That's it.

I think best here would be to reach out to downstream maintainers like jborean93 with WinRM otherwise this will go unnoticed...but I consider your patch reasonable for the time being.
Comment 5 Dan Langille freebsd_committer freebsd_triage 2024-12-09 13:29:39 UTC
I have two concerns:

* changing the default options will break things for existing users - they had X, now they have Y
* Is this patch compatible with older and still supported versions of Python? e.g. if you build this with Python 3.9, will it build and run?
Comment 6 Michael Osipov freebsd_committer freebsd_triage 2024-12-09 13:34:09 UTC
(In reply to Dan Langille from comment #5)

I agree with Dan, the patch conflates two distinct issues.
Comment 7 Christian Ullrich 2024-12-09 14:01:15 UTC
(In reply to Dan Langille from comment #5)

> * changing the default options will break things for existing users - they had X, now they have Y

I agree that should not be changed for POLA, although I personally rather like the idea.

> * Is this patch compatible with older and still supported versions of Python? e.g. if you build this with Python 3.9, will it build and run?

"#define PY_SSIZE_T_CLEAN" is supported - and required - since Python 3.7, so I'd say yes. Per my poudriere, it builds and "import kerberos" works with 3.10, 3.9, and 3.8.
Comment 8 topical 2025-01-17 10:08:29 UTC
(In reply to Dan Langille from comment #5)
I don't know whether this package works at all with GSSAPI_BASE, but you are right that these are 2 different issues.

To make one step after the other, I would be happy if you could at least apply the patch of the source code and leave the default options alone. The source code patch shouldn't impose compatibility issues in terms of Python (see comment #7)

Thank you
Comment 9 Michael Osipov freebsd_committer freebsd_triage 2025-01-17 10:10:40 UTC
FWIW: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277650
Comment 10 Dan Langille freebsd_committer freebsd_triage 2025-01-19 16:19:30 UTC
FYI, the patch is filled with control-M

I fixed it manually, not sure how they got in there, but it's extra work.
Comment 11 commit-hook freebsd_committer freebsd_triage 2025-01-19 16:23:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8d0bd4143c66131728dc6c321af2656752299199

commit 8d0bd4143c66131728dc6c321af2656752299199
Author:     topical <topical@gmx.net>
AuthorDate: 2025-01-19 16:19:01 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2025-01-19 16:22:27 +0000

    security/py-kerberos: Make compatible with python3.11

    PR:             280567

 security/py-kerberos/Makefile                      |  2 +-
 .../py-kerberos/files/patch-src_kerberos.c (new)   | 23 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)