From 591fe16619a17a61b015e2678d3b984cc203781e Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Wed, 22 Nov 2017 09:19:28 +0300 Subject: [PATCH] Fix search of krb5 plugin directory The naive find command currently used to find the krb5 plugin directory can fail, even if it finds a valid path, if it encouters non-readable directories (missing the rx) along the way. Instead, we now prune non-readable directories from the find results via an additional find clause. Fixes #4 [sross@redhat.com: added additional commit description] --- k5test/_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/k5test/_utils.py b/k5test/_utils.py index 7a94e12..e289fac 100644 --- a/k5test/_utils.py +++ b/k5test/_utils.py @@ -97,8 +97,9 @@ def _decide_plugin_dir(dirs): def _find_plugin_dirs_installed(search_path): try: - options_raw = get_output('find %s/ -type d ' - '-path "*/krb5/plugins"' % search_path, + options_raw = get_output('find %s/ -type d \( ! -executable -o ! -readable \) ' + '-prune -o ' + '-type d -path "*/krb5/plugins" -print' % search_path, stderr=subprocess.STDOUT) except subprocess.CalledProcessError: options_raw = None