Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional runtime dependency (Pass::OTP / otptool) causes stderr when missing #195

Open
michaelhaaf opened this issue Mar 1, 2024 · 0 comments

Comments

@michaelhaaf
Copy link

michaelhaaf commented Mar 1, 2024

Problem

(NOTE: edits made).

The runtime dependency otptool is not listed in the installation requirements (unless I'm missing something). I've done a search online and I cannot find a binary/library that corresponds to otptool. is listed as optional (Pass::OTP), but not having it installed causes error messages to print to stderr.

The problematic line of code is here.

OTPTOOL=$(which otptool)

Here is the PR that added it: 0aadd4c

Result

It's not devastating, oathtool works and the correct OTP is ultimately printed on the last line of stdout.

That said, the which command from Line 21 fails and is printed to stderr:

$ pass otp /pass/path/passwordfile
which: no otptool in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
403424

Resolution

Does a tool referred to as otptool still exist? Am I missing something? Should it be added to the list of requirements? Or is it redundant since oathtool works without it, and then should it be removed? Maybe there's an easy answer I'm missing.

Sorry, I forgot to check the git blame when I first opened the ticket. Some actual ideas:

  1. Redirect stderr of which command to /dev/null. For my machine, where I don't have Perl nor Pass::OTP but I do have oathtool, that would look like this:
$ test="$(which otptool 2> /dev/null || true)"
$ echo $test # no stderr, no exit code 1

$ test="$(which oathtool 2> /dev/null || true)"
$ echo $test
/usr/bin/oathtool
  1. Something else?
@michaelhaaf michaelhaaf changed the title Missing runtime dependency: otptool Optional runtime dependency causes stderr (Pass:top / otptool) Mar 1, 2024
@michaelhaaf michaelhaaf changed the title Optional runtime dependency causes stderr (Pass:top / otptool) Optional runtime dependency causes stderr (Pass::OTP / otptool) Mar 1, 2024
@michaelhaaf michaelhaaf changed the title Optional runtime dependency causes stderr (Pass::OTP / otptool) Optional runtime dependency (Pass::OTP / otptool) causes stderr when missing Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant