about summary refs log tree commit diff
path: root/pkgs/development/python-modules/k5test/fix-paths.patch
blob: 04103df36d538fd35be792ae19309ce344fbc148 (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
--- a/k5test/_utils.py
+++ b/k5test/_utils.py
@@ -63,12 +63,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("@krb5Dev@/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("@krb5Dev@/bin/krb5-config --prefix"), "lib")
         _PLUGIN_DIR = _decide_plugin_dir(_find_plugin_dirs_installed(lib_dir))
 
     if _PLUGIN_DIR is not None:
@@ -87,7 +87,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
@@ -96,7 +96,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 \) "
+            "@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")
--- a/k5test/realm.py
+++ b/k5test/realm.py
@@ -84,7 +84,7 @@ class K5Realm(metaclass=abc.ABCMeta):
         provider_cls = cls
 
         if provider_cls == K5Realm:
-            krb5_config = _discover_path("krb5-config", "/usr/bin/krb5-config", kwargs)
+            krb5_config = _discover_path("krb5-config", "@krb5@/bin/krb5-config", kwargs)
 
             try:
                 krb5_version = subprocess.check_output(
@@ -96,7 +96,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"
+                    sys.platform == "darwin" and krb5_config == "@krb5@/bin/krb5-config"
                 ):
                     provider_cls = HeimdalRealm
                 else:
@@ -457,14 +457,14 @@ class MITRealm(K5Realm):
     @property
     def _default_paths(self):
         return [
-            ("kdb5_util", "kdb5_util", "/usr/sbin/kdb5_util"),
-            ("krb5kdc", "krb5kdc", "/usr/sbin/krb5kdc"),
-            ("kadmin", "kadmin", "/usr/bin/kadmin"),
-            ("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", "@krb5@/bin/kdb5_util"),
+            ("krb5kdc", "krb5kdc", "@krb5@/bin/krb5kdc"),
+            ("kadmin", "kadmin", "@krb5@/bin/kadmin"),
+            ("kadmin_local", "kadmin.local", "@krb5@/bin/kadmin.local"),
+            ("kadmind", "kadmind", "@krb5@/bin/kadmind"),
+            ("kprop", "kprop", "@krb5@/bin/kprop"),
+            ("_kinit", "kinit", "@krb5@/bin/kinit"),
+            ("_klist", "klist", "@krb5@/bin/klist"),
         ]
 
     @property
@@ -625,12 +625,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", "@krb5@/bin/kadmin"),
+            ("kadmin_local", "kadmin", "@krb5@/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", "@krb5@/bin/kinit"),
+            ("_klist", "klist", "@krb5@/bin/klist"),
+            ("_ktutil", "ktutil", "@krb5@/bin/ktutil"),
         ]
 
     @property
--- a/k5test/unit.py
+++ b/k5test/unit.py
@@ -39,7 +39,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("@krb5Dev@/bin/krb5-config --version")
         _KRB_VERSION = _KRB_VERSION.split(" ")[-1].split(".")
 
     def make_ext_test(func):