summary refs log tree commit diff
path: root/pkgs/development/python-modules/k5test/fix-paths.patch
blob: dc6caf815809994104d3e5af1cedf4253c9e9152 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
diff --git a/k5test/_utils.py b/k5test/_utils.py
index e289fac..e2f486a 100644
--- a/k5test/_utils.py
+++ b/k5test/_utils.py
@@ -65,12 +65,12 @@ def find_plugin_dir():
 
     # if there was no LD_LIBRARY_PATH, or the above failed
     if _PLUGIN_DIR is None:
-        lib_dir = os.path.join(get_output('krb5-config --prefix'), 'lib64')
+        lib_dir = os.path.join(get_output('@krb5FullDev@/bin/krb5-config --prefix'), 'lib64')
         _PLUGIN_DIR = _decide_plugin_dir(_find_plugin_dirs_installed(lib_dir))
 
     # /usr/lib64 seems only to be distinct on Fedora/RHEL/Centos family
     if _PLUGIN_DIR is None:
-        lib_dir = os.path.join(get_output('krb5-config --prefix'), 'lib')
+        lib_dir = os.path.join(get_output('@krb5FullDev@/bin/krb5-config --prefix'), 'lib')
         _PLUGIN_DIR = _decide_plugin_dir(_find_plugin_dirs_installed(lib_dir))
 
     if _PLUGIN_DIR is not None:
@@ -89,7 +89,7 @@ def _decide_plugin_dir(dirs):
 
     for path in shortest_first:
         # check to see if it actually contains .so files
-        if get_output('find %s -name "*.so"' % path):
+        if get_output('@findutils@/bin/find %s -name "*.so"' % path):
             return path
 
     return None
@@ -97,7 +97,7 @@ def _decide_plugin_dir(dirs):
 
 def _find_plugin_dirs_installed(search_path):
     try:
-        options_raw = get_output('find %s/ -type d \( ! -executable -o ! -readable \) '
+        options_raw = get_output('@findutils@/bin/find %s/ -type d \( ! -executable -o ! -readable \) '
                                  '-prune -o '
                                  '-type d -path "*/krb5/plugins" -print' % search_path,
                                  stderr=subprocess.STDOUT)
@@ -111,7 +111,7 @@ def _find_plugin_dirs_installed(search_path):
 
 
 def _find_plugin_dirs_src(search_path):
-    options_raw = get_output('find %s/../ -type d -name plugins' % search_path)
+    options_raw = get_output('@findutils@/bin/find %s/../ -type d -name plugins' % search_path)
 
     if options_raw:
         return options_raw.split('\n')
diff --git a/k5test/realm.py b/k5test/realm.py
index 161e5ad..9f50049 100644
--- a/k5test/realm.py
+++ b/k5test/realm.py
@@ -90,7 +90,7 @@ class K5Realm(metaclass=abc.ABCMeta):
 
         if provider_cls == K5Realm:
             krb5_config = _discover_path('krb5-config',
-                                         '/usr/bin/krb5-config', kwargs)
+                                         '@krb5Full@/bin/krb5-config', kwargs)
 
             try:
                 krb5_version = subprocess.check_output(
@@ -101,7 +101,7 @@ class K5Realm(metaclass=abc.ABCMeta):
                 # macOS output doesn't contain Heimdal
                 if 'heimdal' in krb5_version.lower() or (
                         sys.platform == 'darwin' and
-                        krb5_config == '/usr/bin/krb5-config'):
+                        krb5_config == '@krb5Full@/bin/krb5-config'):
                     provider_cls = HeimdalRealm
                 else:
                     provider_cls = MITRealm
@@ -434,14 +434,14 @@ class MITRealm(K5Realm):
     @property
     def _default_paths(self):
         return [
-            ('kdb5_util', 'kdb5_util', '/usr/sbin/kdb5_util'),
-            ('krb5kdc', 'krb5kdc', '/usr/sbin/kdb5kdc'),
-            ('kadmin', 'kadmin', '/usr/bin/admin'),
-            ('kadmin_local', 'kadmin.local', '/usr/sbin/kadmin.local'),
-            ('kadmind', 'kadmind', '/usr/sbin/kadmind'),
-            ('kprop', 'kprop', '/usr/sbin/kprop'),
-            ('_kinit', 'kinit', '/usr/bin/kinit'),
-            ('_klist', 'klist', '/usr/bin/klist'),
+            ('kdb5_util', 'kdb5_util', '@krb5Full@/bin/kdb5_util'),
+            ('krb5kdc', 'krb5kdc', '@krb5Full@/bin/kdb5kdc'),
+            ('kadmin', 'kadmin', '@krb5Full@/bin/admin'),
+            ('kadmin_local', 'kadmin.local', '@krb5Full@/bin/kadmin.local'),
+            ('kadmind', 'kadmind', '@krb5Full@/bin/kadmind'),
+            ('kprop', 'kprop', '@krb5Full@/bin/kprop'),
+            ('_kinit', 'kinit', '@krb5Full@/bin/kinit'),
+            ('_klist', 'klist', '@krb5Full@/bin/klist'),
         ]
 
     @property
@@ -585,12 +585,12 @@ class HeimdalRealm(K5Realm):
 
         return [
             ('krb5kdc', 'kdc', os.path.join(base, 'kdc')),
-            ('kadmin', 'kadmin', '/usr/bin/kadmin'),
-            ('kadmin_local', 'kadmin', '/usr/bin/kadmin'),
+            ('kadmin', 'kadmin', '@krb5Full@/bin/kadmin'),
+            ('kadmin_local', 'kadmin', '@krb5Full@/bin/kadmin'),
             ('kadmind', 'kadmind', os.path.join(base, 'kadmind')),
-            ('_kinit', 'kinit', '/usr/bin/kinit'),
-            ('_klist', 'klist', '/usr/bin/klist'),
-            ('_ktutil', 'ktutil', '/usr/bin/ktutil'),
+            ('_kinit', 'kinit', '@krb5Full@/bin/kinit'),
+            ('_klist', 'klist', '@krb5Full@/bin/klist'),
+            ('_ktutil', 'ktutil', '@krb5Full@/bin/ktutil'),
         ]
 
     @property
diff --git a/k5test/unit.py b/k5test/unit.py
index 3c64b9e..59da1ab 100644
--- a/k5test/unit.py
+++ b/k5test/unit.py
@@ -38,7 +38,7 @@ _KRB_VERSION = None
 def krb_minversion_test(target_version, problem, provider=None):
     global _KRB_VERSION
     if _KRB_VERSION is None:
-        _KRB_VERSION = _utils.get_output("krb5-config --version")
+        _KRB_VERSION = _utils.get_output("@krb5FullDev@/bin/krb5-config --version")
         _KRB_VERSION = _KRB_VERSION.split(' ')[-1].split('.')
 
     def make_ext_test(func):