From e568c74f2fd9b5a43b7d31e36479efca3e643d03f8ed1b47b01a5f83eddcd750 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 15 Apr 2020 07:18:32 +0000 Subject: [PATCH] Accepting request 792641 from home:pgajdos - version update to 1.6.1 * lot of changes, see https://github.com/gssapi/mod_auth_gssapi/releases - added patches python3 and other testsuite fixes + apache2-mod_auth_gssapi-test.patch OBS-URL: https://build.opensuse.org/request/show/792641 OBS-URL: https://build.opensuse.org/package/show/Apache:Modules/apache2-mod_auth_gssapi?expand=0&rev=4 --- apache2-mod_auth_gssapi-test.patch | 83 +++++++++++++++++++++ apache2-mod_auth_gssapi.changes | 10 +++ apache2-mod_auth_gssapi.spec | 112 ++++++++++------------------- mod_auth_gssapi-1.5.0.tar.gz | 3 - mod_auth_gssapi-1.6.1.tar.gz | 3 + 5 files changed, 134 insertions(+), 77 deletions(-) create mode 100644 apache2-mod_auth_gssapi-test.patch delete mode 100644 mod_auth_gssapi-1.5.0.tar.gz create mode 100644 mod_auth_gssapi-1.6.1.tar.gz diff --git a/apache2-mod_auth_gssapi-test.patch b/apache2-mod_auth_gssapi-test.patch new file mode 100644 index 0000000..f251782 --- /dev/null +++ b/apache2-mod_auth_gssapi-test.patch @@ -0,0 +1,83 @@ +Index: mod_auth_gssapi-1.6.1/tests/magtests.py +=================================================================== +--- mod_auth_gssapi-1.6.1.orig/tests/magtests.py 2017-12-14 22:36:18.444067659 +0100 ++++ mod_auth_gssapi-1.6.1/tests/magtests.py 2020-04-09 09:16:04.680455654 +0200 +@@ -8,6 +8,7 @@ import shutil + import signal + import subprocess + import sys ++import time + + # check that we can import requests (for use in test scripts) + import requests +@@ -302,7 +303,7 @@ def setup_kdc(testdir, wrapenv): + with open(kdcconf, 'w+') as f: + f.write(text) + +- kdcenv = {'PATH': '/sbin:/bin:/usr/sbin:/usr/bin', ++ kdcenv = {'PATH': '/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin', + 'KRB5_CONFIG': krb5conf, + 'KRB5_KDC_PROFILE': kdcconf, + 'KRB5_TRACE': os.path.join(testdir, 'krbtrace.log')} +@@ -391,6 +392,11 @@ def setup_http(testdir, so_dir, wrapenv) + distro = "Debian" + moddir = "/usr/lib/apache2/modules" + if not os.path.exists(moddir): ++ distro = "SUSE" ++ moddir = "/usr/lib64/apache2" ++ if not os.path.exists(moddir): ++ moddir = "/usr/lib/apache2" ++ if not os.path.exists(moddir): + raise ValueError("Could not find Apache module directory!") + os.symlink(moddir, os.path.join(httpdir, 'modules')) + +@@ -414,7 +420,7 @@ def setup_http(testdir, so_dir, wrapenv) + 'MALLOC_PERTURB_': str(random.randint(0, 32767) % 255 + 1)} + httpenv.update(wrapenv) + +- httpd = "httpd" if distro == "Fedora" else "apache2" ++ httpd = "httpd" if (distro == "Fedora") or (distro == "SUSE") else "apache2" + httpproc = subprocess.Popen([httpd, '-DFOREGROUND', '-f', config], + env=httpenv, preexec_fn=os.setsid) + return httpproc +@@ -427,11 +433,11 @@ def kinit_user(testdir, kdcenv): + testenv.update(kdcenv) + + with (open(testlog, 'a')) as logfile: +- kinit = subprocess.Popen(["kinit", USR_NAME], ++ kinit = subprocess.Popen(["kinit", "-V", USR_NAME], + stdin=subprocess.PIPE, + stdout=logfile, stderr=logfile, + env=testenv, preexec_fn=os.setsid) +- kinit.communicate('%s\n' % USR_PWD) ++ kinit.communicate(input=bytes(USR_PWD, 'utf-8')) + kinit.wait() + if kinit.returncode != 0: + raise ValueError('kinit failed') +Index: mod_auth_gssapi-1.6.1/tests/httpd.conf +=================================================================== +--- mod_auth_gssapi-1.6.1.orig/tests/httpd.conf 2017-12-14 22:36:11.396207833 +0100 ++++ mod_auth_gssapi-1.6.1/tests/httpd.conf 2020-04-09 09:15:13.456205265 +0200 +@@ -71,7 +71,9 @@ LoadModule userdir_module modules/mod_us + LoadModule version_module modules/mod_version.so + + LoadModule vhost_alias_module modules/mod_vhost_alias.so ++ + LoadModule mpm_prefork_module modules/mod_mpm_prefork.so ++ + LoadModule proxy_module modules/mod_proxy.so + LoadModule proxy_http_module modules/mod_proxy_http.so + +Index: mod_auth_gssapi-1.6.1/tests/t_spnego_proxy.py +=================================================================== +--- mod_auth_gssapi-1.6.1.orig/tests/t_spnego_proxy.py 2017-12-14 22:36:18.444067659 +0100 ++++ mod_auth_gssapi-1.6.1/tests/t_spnego_proxy.py 2020-04-09 09:15:13.456205265 +0200 +@@ -17,7 +17,7 @@ def getAuthToken(target): + ctx = gssapi.SecurityContext(name=name, mech=spnego_mech) + token = ctx.step() + +- return 'Negotiate %s' % b64encode(token) ++ return 'Negotiate %s' % b64encode(token).decode('utf-8') + + + if __name__ == '__main__': diff --git a/apache2-mod_auth_gssapi.changes b/apache2-mod_auth_gssapi.changes index 434a9d3..ca0f128 100644 --- a/apache2-mod_auth_gssapi.changes +++ b/apache2-mod_auth_gssapi.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Apr 8 14:44:12 UTC 2020 - pgajdos@suse.com + +- version update to 1.6.1 + * lot of changes, see + https://github.com/gssapi/mod_auth_gssapi/releases +- added patches + python3 and other testsuite fixes + + apache2-mod_auth_gssapi-test.patch + ------------------------------------------------------------------- Sun Feb 9 20:12:17 UTC 2020 - pgajdos@suse.com diff --git a/apache2-mod_auth_gssapi.spec b/apache2-mod_auth_gssapi.spec index c197f20..0e4c16c 100644 --- a/apache2-mod_auth_gssapi.spec +++ b/apache2-mod_auth_gssapi.spec @@ -1,7 +1,7 @@ # # spec file for package apache2-mod_auth_gssapi # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2004, 2005 NOVELL (All rights reserved) # # All modifications and additions to the file contributed by third parties @@ -13,97 +13,61 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # -# this is required to be underscore -%define module_name mod_auth_gssapi -%if ! %{?distro:1}0 -%if %{?suse_version:1}0 - %define distro suse -%endif -%if %{?fedora_version:1}0 - %define distro redhat -%endif -%endif -%if ! %{?distro:1}0 - %define distro suse -%endif -%if %{distro} == "suse" -BuildRequires: apache2-devel +Name: apache2-mod_auth_gssapi +Version: 1.6.1 +Release: 0 +Summary: GSSAPI Module for Apache +License: MIT +URL: https://github.com/modauthgssapi/mod_auth_gssapi/ +Source0: https://github.com/modauthgssapi/mod_auth_gssapi/releases/download/v%{version}/mod_auth_gssapi-%{version}.tar.gz +# python3 and other testsuite fixes +Patch0: apache2-mod_auth_gssapi-test.patch BuildRequires: apache-rpm-macros +BuildRequires: apache2-devel +BuildRequires: krb5-devel +BuildRequires: openssl-devel Requires: %{apache_mmn} Requires: %{apache_suse_maintenance_mmn} Requires: apache2 -# FIXME: use proper Requires(pre/post/preun/...) -PreReq: apache2-prefork -PreReq: apparmor-parser -%else -%if %{distro} == "redhat" || %{distro} == "rhel4" -%define apxs %{_sbindir}/apxs -%define apache_libexecdir %(%{apxs} -q LIBEXECDIR) -%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR) -BuildRequires: httpd-devel -# FIXME: use proper Requires(pre/post/preun/...) -PreReq: httpd -%endif -%endif -Name: apache2-mod_auth_gssapi -Version: 1.5.0 -Release: 0 -Summary: GSSAPI Module for Apache -License: MIT -Group: Applications/System -Url: https://github.com/modauthgssapi/mod_auth_gssapi/releases/download/v1.5.0/mod_auth_gssapi-1.5.0.tar.gz -Source0: %{module_name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: openssl-devel -BuildRequires: krb5-devel +# SECTION test requirements +BuildRequires: krb5-client +BuildRequires: krb5-plugin-preauth-pkinit +BuildRequires: krb5-server +BuildRequires: nss_wrapper +BuildRequires: python3-gssapi +BuildRequires: python3-requests-gssapi +BuildRequires: python3-requests-kerberos +BuildRequires: socket_wrapper +# /SECTION %description -apache2-mod_apparmor adds support to apache2 to provide AppArmor confinement -to individual cgi scripts handled by apache modules like mod_php and -mod_perl. -This package is part of a suite of tools that used to be named SubDomain. +This module has been built as a replacement for the aging +mod_auth_kerb. Its aim is to use only GSSAPI calls and be +as much as possible agnostic of the actual mechanism used. %prep - -%setup -q -n %{module_name}-%{version} +%setup -q -n mod_auth_gssapi-%{version} +%patch0 -p1 %build %configure -make %{?_smp_mflags} APXS=%{apache_apxs} +%make_build APXS=%{apache_apxs} %install -make install DESTDIR=%{buildroot} DISTRO=%{distro} MANDIR=%{_mandir} +%make_install +rm %{buildroot}%{apache_libexecdir}/*.la -%if %{distro} == "suse" - mkdir -p %{buildroot}%{_libdir}/apache2-prefork/ - ln -s %{apache_libexecdir}/%{module_name}.so %{buildroot}%{_libdir}/apache2-prefork/%{module_name}.so -%else - %if %{distro} == "redhat" || %{distro} == "rhel4" - mkdir -p %{buildroot}/%{apache_sysconfdir}.d/ - install -m 644 %{module_name}.conf %{buildroot}/%{apache_sysconfdir}.d/ - %endif -%endif +%check +sed -i 's/env python/python3/' tests/*.py +make check %files -%defattr(-,root,root) -%doc COPYING README -%{apache_libexecdir} -%if %{distro} == "suse" -%{_libdir}/apache2-prefork/%{module_name}.so -%else - %if %{distro} == "redhat" || %{distro} == "rhel4" - %{apache_sysconfdir}.d/%{module_name}.conf - %endif -%endif - -%triggerpostun -- mod_change_hat mod-change-hat - -%if %{distro} == "suse" - %{_sbindir}/a2enmod auth_gssapi -%endif +%license COPYING +%doc README +%{apache_libexecdir}/*.so %changelog diff --git a/mod_auth_gssapi-1.5.0.tar.gz b/mod_auth_gssapi-1.5.0.tar.gz deleted file mode 100644 index 9a078d0..0000000 --- a/mod_auth_gssapi-1.5.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:99d2e1bdba964977c12a1b8ea195717f8b09ec799c61d4873905da3b1f5656ab -size 444745 diff --git a/mod_auth_gssapi-1.6.1.tar.gz b/mod_auth_gssapi-1.6.1.tar.gz new file mode 100644 index 0000000..e1fd38b --- /dev/null +++ b/mod_auth_gssapi-1.6.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8fd06f4d46b6287796d6ccbe93290d02a9dbd76bc7db75e03d366ad34151854 +size 501237