Skip to content

Commit

Permalink
Fix search of krb5 plugin directory
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
stanislavlevin authored and DirectXMan12 committed Nov 28, 2017
1 parent ef9d185 commit 591fe16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions k5test/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 591fe16

Please sign in to comment.