--- 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", "@krb5Dev@/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 == "@krb5Dev@/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):