Skip to content

k5test should use passed in paths, even when system krb5 is present #2

Open
@DirectXMan12

Description

@DirectXMan12

Currently, the _discover_path function in realm.py does the following:

  1. checks $PATH with which, return that if present
  2. if not found on $PATH, check in the user-specified paths dict, and return that if present
  3. if not found in the user-specified paths dict, return some default path (/usr/sbin/xyz or /usr/bin/xyz).

This means that system copies installed on $PATH would always be chosen over manually specified paths in the constructor. Instead, the logic should probably instead be:

  1. check in the user-specified paths dict, and return that if present
  2. if not found in the user-specified paths dict, check $PATH with which, return that if present
  3. if not found on $PATH, return some default value

This way, if a user manually specifies a path for some binary, we use that even if there's a system copy installed on $PATH (note that the default value is necessary since /usr/sbin isn't generally on $PATH for non-root users)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions