apache2-mod_auth_gssapi/apache2-mod_auth_gssapi-test.patch
2020-04-15 07:18:32 +00:00

84 lines
3.6 KiB
Diff

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
</IfModule>
LoadModule vhost_alias_module modules/mod_vhost_alias.so
+<IfModule !prefork.c>
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
+</IfModule>
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__':