Mageia Bugzilla – Attachment 14447 Details for
Bug 32954
upgrading/rebuildin pam-python for python-3.12
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
rediff/adjust of mageia build pam-python-1.0.6-build.patch
pam-python-1.1.0-build.patch (text/plain), 6.33 KB, created by
Aurelian R
on 2024-03-10 10:56:01 CET
(
hide
)
Description:
rediff/adjust of mageia build pam-python-1.0.6-build.patch
Filename:
MIME Type:
Creator:
Aurelian R
Created:
2024-03-10 10:56:01 CET
Size:
6.33 KB
patch
obsolete
>diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/ctest.c pam-python-1.1.0-20240207git4a09616/src/ctest.c >--- pam-python-1.1.0-20240207git4a09616_Old/src/ctest.c 2024-02-07 09:26:34.000000000 +0200 >+++ pam-python-1.1.0-20240207git4a09616/src/ctest.c 2024-03-09 17:27:36.386144456 +0200 >@@ -20,7 +20,7 @@ > #include <unistd.h> > > struct walk_info { >- const char* pam_python_so; >+ const char* pam_python3_so; > int libpam_python_seen; > int python_seen; > }; >@@ -62,7 +62,7 @@ static void walk_dlls(struct walk_info* > walk_info->python_seen = 0; > for (image_index = 0; image_index < _dyld_image_count(); image_index += 1) { > const char* image_name = _dyld_get_image_name(image_index); >- if (strstr(image_name, "/pam_python.so") != 0) >+ if (strstr(image_name, "/pam_python3.so") != 0) > walk_info->libpam_python_seen = 1; > if (strstr(image_name, "/libpython") != 0) > walk_info->python_seen = 1; >@@ -74,7 +74,7 @@ static int dl_walk(struct dl_phdr_info* > struct walk_info* walk_info = data; > > (void)size; >- if (strstr(info->dlpi_name, "/pam_python.so") != 0) >+ if (strstr(info->dlpi_name, "/pam_python3.so") != 0) > walk_info->libpam_python_seen = 1; > if (strstr(info->dlpi_name, "/libpython") != 0) > walk_info->python_seen = 1; >@@ -133,13 +133,13 @@ int main(int argc, char **argv) > call_pam(&exit_status, "pam_close_session", pamh, pam_close_session); > sprintf(filename, "/pam_%s.so", pyver); > memset(&walk_info_before, 0, sizeof(walk_info_before)); >- walk_info_before.pam_python_so = filename; >+ walk_info_before.pam_python3_so = filename; > walk_dlls(&walk_info_before); > call_pam(&exit_status, "pam_end", pamh, pam_end); > if (exit_status == 0) > printf(" OK\n"); > memset(&walk_info_after, 0, sizeof(walk_info_after)); >- walk_info_after.pam_python_so = filename; >+ walk_info_after.pam_python3_so = filename; > walk_dlls(&walk_info_after); > printf("Testing dll load/unload "); > if (!walk_info_before.libpam_python_seen) >diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/Makefile pam-python-1.1.0-20240207git4a09616/src/Makefile >--- pam-python-1.1.0-20240207git4a09616_Old/src/Makefile 2024-02-07 09:26:34.000000000 +0200 >+++ pam-python-1.1.0-20240207git4a09616/src/Makefile 2024-03-09 17:27:36.386144456 +0200 >@@ -1,29 +1,29 @@ > PYTHON ?= python3 > >-all: ctest pam_python.so test-pam_$(PYTHON).pam >+all: ctest pam_$(PYTHON).so test-pam_$(PYTHON).pam > >-WARNINGS=-Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Werror >+WARNINGS=$(OPTFLAGS) -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations > #WARNINGS=-Wunreachable-code # Gcc 4.1 .. 4.4 are too buggy to make this useful > > LIBDIR ?= /lib/security > >-pam_python.so: pam_python.c setup.py Makefile >+pam_$(PYTHON).so: pam_python.c setup.py Makefile > @rm -f "$@" > @[ ! -e build -o build/lib.*/$@ -nt setup.py -a build/lib.*/$@ -nt Makefile ] || rm -r build > CFLAGS="$(CFLAGS) $(WARNINGS) -I/usr/local/lib/ " $(PYTHON) setup.py build --debug > @#CFLAGS="$(CFLAGS) -Og $(WARNINGS)" $(PYTHON) setup.py build --debug > @#CFLAGS="$(CFLAGS) -Og $(WARNINGS)" Py_DEBUG=1 $(PYTHON) setup.py build --debug >- ln -sf $$(find build/lib.*/pam_python*.so -type f | head -n1) $@ >+ ln -sf $$(find build/lib.*/pam_$(PYTHON)*.so -type f | head -n1) $@ > > .PHONY: install install-lib > install: install-lib > install-lib: > mkdir -p $(DESTDIR)$(LIBDIR) >- cp build/lib.*/pam_python.*.so $(DESTDIR)$(LIBDIR)/pam_python.so >+ cp build/lib.*/pam_$(PYTHON).*.so $(DESTDIR)$(LIBDIR)/pam_$(PYTHON).so > > .PHONY: clean > clean: >- rm -rf build ctest pam_python.so test-pam_$(PYTHON).pam test.pyc core __pycache__ >+ rm -rf build ctest pam_$(PYTHON).so test-pam_$(PYTHON).pam test.pyc core __pycache__ > [ ! -e /etc/pam.d/test-pam_$(PYTHON).pam ] || { s=$$([ $$(id -u) = 0 ] || echo sudo); $$s rm -f /etc/pam.d/test-pam_$(PYTHON).pam; } > [ ! -e /etc/pam.d/test-pam_$(PYTHON)-installed.pam ] || { s=$$([ $$(id -u) = 0 ] || echo sudo); $$s rm -f /etc/pam.d/test-pam_$(PYTHON)-installed.pam; } > >@@ -39,12 +39,12 @@ test-pam_$(PYTHON).pam: test-pam_python. > s=$$([ $$(id -u) = 0 ] || echo sudo); $$s ln -sf $$(pwd)/test-pam_$(PYTHON).pam /etc/pam.d > > .PHONY: test >-test: pam_python.so ctest /etc/pam.d/test-pam_$(PYTHON).pam >+test: pam_$(PYTHON).so ctest /etc/pam.d/test-pam_$(PYTHON).pam > $(PYTHON) test.py > ./ctest $(PYTHON) > > test-pam_$(PYTHON)-installed.pam: test-pam_python.pam.in Makefile >- sed "s,\\\$$PWD/pam_python.so,pam_python.so,;s,\\\$$PWD,$$(pwd),g" "$<" >"$@.tmp" >+ sed "s,\\\$$PWD/pam_$(PYTHON).so,pam_$(PYTHON).so,;s,\\\$$PWD,$$(pwd),g" "$<" >"$@.tmp" > mv $@.tmp $@ > > /etc/pam.d/test-pam_$(PYTHON)-installed.pam: test-pam_$(PYTHON)-installed.pam >diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/setup.py pam-python-1.1.0-20240207git4a09616/src/setup.py >--- pam-python-1.1.0-20240207git4a09616_Old/src/setup.py 2024-02-07 09:26:34.000000000 +0200 >+++ pam-python-1.1.0-20240207git4a09616/src/setup.py 2024-03-09 17:27:36.386144456 +0200 >@@ -36,12 +36,12 @@ else: > libpython_so = sysconfig.get_config_var('INSTSONAME') > ext_modules = [ > Extension( >- "pam_python", >+ "pam_python3", > sources=["pam_python.c"], > include_dirs = [], > library_dirs=[], > define_macros=[('LIBPYTHON_SO','"'+libpython_so+'"')] + Py_DEBUG, >- libraries=["pam","python%d.%d%s" % ( sys.version_info[0], sys.version_info[1], sysconfig.get_config_var('ABIFLAGS'))], >+ libraries=["dl","pam"], > ), ] > > setup( >diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/test-pam_python.pam.in pam-python-1.1.0-20240207git4a09616/src/test-pam_python.pam.in >--- pam-python-1.1.0-20240207git4a09616_Old/src/test-pam_python.pam.in 2024-02-07 09:26:34.000000000 +0200 >+++ pam-python-1.1.0-20240207git4a09616/src/test-pam_python.pam.in 2024-03-09 17:27:36.386144456 +0200 >@@ -1,4 +1,4 @@ >-auth required $PWD/pam_python.so $PWD/test.py >-account required $PWD/pam_python.so $PWD/test.py arg1 arg2 >-password required $PWD/pam_python.so $PWD/test.py >-session required $PWD/pam_python.so $PWD/test.py >+auth required $PWD/pam_python3.so $PWD/test.py >+account required $PWD/pam_python3.so $PWD/test.py arg1 arg2 >+password required $PWD/pam_python3.so $PWD/test.py >+session required $PWD/pam_python3.so $PWD/test.py
diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/ctest.c pam-python-1.1.0-20240207git4a09616/src/ctest.c --- pam-python-1.1.0-20240207git4a09616_Old/src/ctest.c 2024-02-07 09:26:34.000000000 +0200 +++ pam-python-1.1.0-20240207git4a09616/src/ctest.c 2024-03-09 17:27:36.386144456 +0200 @@ -20,7 +20,7 @@ #include <unistd.h> struct walk_info { - const char* pam_python_so; + const char* pam_python3_so; int libpam_python_seen; int python_seen; }; @@ -62,7 +62,7 @@ static void walk_dlls(struct walk_info* walk_info->python_seen = 0; for (image_index = 0; image_index < _dyld_image_count(); image_index += 1) { const char* image_name = _dyld_get_image_name(image_index); - if (strstr(image_name, "/pam_python.so") != 0) + if (strstr(image_name, "/pam_python3.so") != 0) walk_info->libpam_python_seen = 1; if (strstr(image_name, "/libpython") != 0) walk_info->python_seen = 1; @@ -74,7 +74,7 @@ static int dl_walk(struct dl_phdr_info* struct walk_info* walk_info = data; (void)size; - if (strstr(info->dlpi_name, "/pam_python.so") != 0) + if (strstr(info->dlpi_name, "/pam_python3.so") != 0) walk_info->libpam_python_seen = 1; if (strstr(info->dlpi_name, "/libpython") != 0) walk_info->python_seen = 1; @@ -133,13 +133,13 @@ int main(int argc, char **argv) call_pam(&exit_status, "pam_close_session", pamh, pam_close_session); sprintf(filename, "/pam_%s.so", pyver); memset(&walk_info_before, 0, sizeof(walk_info_before)); - walk_info_before.pam_python_so = filename; + walk_info_before.pam_python3_so = filename; walk_dlls(&walk_info_before); call_pam(&exit_status, "pam_end", pamh, pam_end); if (exit_status == 0) printf(" OK\n"); memset(&walk_info_after, 0, sizeof(walk_info_after)); - walk_info_after.pam_python_so = filename; + walk_info_after.pam_python3_so = filename; walk_dlls(&walk_info_after); printf("Testing dll load/unload "); if (!walk_info_before.libpam_python_seen) diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/Makefile pam-python-1.1.0-20240207git4a09616/src/Makefile --- pam-python-1.1.0-20240207git4a09616_Old/src/Makefile 2024-02-07 09:26:34.000000000 +0200 +++ pam-python-1.1.0-20240207git4a09616/src/Makefile 2024-03-09 17:27:36.386144456 +0200 @@ -1,29 +1,29 @@ PYTHON ?= python3 -all: ctest pam_python.so test-pam_$(PYTHON).pam +all: ctest pam_$(PYTHON).so test-pam_$(PYTHON).pam -WARNINGS=-Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Werror +WARNINGS=$(OPTFLAGS) -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations #WARNINGS=-Wunreachable-code # Gcc 4.1 .. 4.4 are too buggy to make this useful LIBDIR ?= /lib/security -pam_python.so: pam_python.c setup.py Makefile +pam_$(PYTHON).so: pam_python.c setup.py Makefile @rm -f "$@" @[ ! -e build -o build/lib.*/$@ -nt setup.py -a build/lib.*/$@ -nt Makefile ] || rm -r build CFLAGS="$(CFLAGS) $(WARNINGS) -I/usr/local/lib/ " $(PYTHON) setup.py build --debug @#CFLAGS="$(CFLAGS) -Og $(WARNINGS)" $(PYTHON) setup.py build --debug @#CFLAGS="$(CFLAGS) -Og $(WARNINGS)" Py_DEBUG=1 $(PYTHON) setup.py build --debug - ln -sf $$(find build/lib.*/pam_python*.so -type f | head -n1) $@ + ln -sf $$(find build/lib.*/pam_$(PYTHON)*.so -type f | head -n1) $@ .PHONY: install install-lib install: install-lib install-lib: mkdir -p $(DESTDIR)$(LIBDIR) - cp build/lib.*/pam_python.*.so $(DESTDIR)$(LIBDIR)/pam_python.so + cp build/lib.*/pam_$(PYTHON).*.so $(DESTDIR)$(LIBDIR)/pam_$(PYTHON).so .PHONY: clean clean: - rm -rf build ctest pam_python.so test-pam_$(PYTHON).pam test.pyc core __pycache__ + rm -rf build ctest pam_$(PYTHON).so test-pam_$(PYTHON).pam test.pyc core __pycache__ [ ! -e /etc/pam.d/test-pam_$(PYTHON).pam ] || { s=$$([ $$(id -u) = 0 ] || echo sudo); $$s rm -f /etc/pam.d/test-pam_$(PYTHON).pam; } [ ! -e /etc/pam.d/test-pam_$(PYTHON)-installed.pam ] || { s=$$([ $$(id -u) = 0 ] || echo sudo); $$s rm -f /etc/pam.d/test-pam_$(PYTHON)-installed.pam; } @@ -39,12 +39,12 @@ test-pam_$(PYTHON).pam: test-pam_python. s=$$([ $$(id -u) = 0 ] || echo sudo); $$s ln -sf $$(pwd)/test-pam_$(PYTHON).pam /etc/pam.d .PHONY: test -test: pam_python.so ctest /etc/pam.d/test-pam_$(PYTHON).pam +test: pam_$(PYTHON).so ctest /etc/pam.d/test-pam_$(PYTHON).pam $(PYTHON) test.py ./ctest $(PYTHON) test-pam_$(PYTHON)-installed.pam: test-pam_python.pam.in Makefile - sed "s,\\\$$PWD/pam_python.so,pam_python.so,;s,\\\$$PWD,$$(pwd),g" "$<" >"$@.tmp" + sed "s,\\\$$PWD/pam_$(PYTHON).so,pam_$(PYTHON).so,;s,\\\$$PWD,$$(pwd),g" "$<" >"$@.tmp" mv $@.tmp $@ /etc/pam.d/test-pam_$(PYTHON)-installed.pam: test-pam_$(PYTHON)-installed.pam diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/setup.py pam-python-1.1.0-20240207git4a09616/src/setup.py --- pam-python-1.1.0-20240207git4a09616_Old/src/setup.py 2024-02-07 09:26:34.000000000 +0200 +++ pam-python-1.1.0-20240207git4a09616/src/setup.py 2024-03-09 17:27:36.386144456 +0200 @@ -36,12 +36,12 @@ else: libpython_so = sysconfig.get_config_var('INSTSONAME') ext_modules = [ Extension( - "pam_python", + "pam_python3", sources=["pam_python.c"], include_dirs = [], library_dirs=[], define_macros=[('LIBPYTHON_SO','"'+libpython_so+'"')] + Py_DEBUG, - libraries=["pam","python%d.%d%s" % ( sys.version_info[0], sys.version_info[1], sysconfig.get_config_var('ABIFLAGS'))], + libraries=["dl","pam"], ), ] setup( diff -Nurp pam-python-1.1.0-20240207git4a09616_Old/src/test-pam_python.pam.in pam-python-1.1.0-20240207git4a09616/src/test-pam_python.pam.in --- pam-python-1.1.0-20240207git4a09616_Old/src/test-pam_python.pam.in 2024-02-07 09:26:34.000000000 +0200 +++ pam-python-1.1.0-20240207git4a09616/src/test-pam_python.pam.in 2024-03-09 17:27:36.386144456 +0200 @@ -1,4 +1,4 @@ -auth required $PWD/pam_python.so $PWD/test.py -account required $PWD/pam_python.so $PWD/test.py arg1 arg2 -password required $PWD/pam_python.so $PWD/test.py -session required $PWD/pam_python.so $PWD/test.py +auth required $PWD/pam_python3.so $PWD/test.py +account required $PWD/pam_python3.so $PWD/test.py arg1 arg2 +password required $PWD/pam_python3.so $PWD/test.py +session required $PWD/pam_python3.so $PWD/test.py
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32954
:
14445
|
14446
| 14447