Skip to content

Conversation

jorti
Copy link

@jorti jorti commented Nov 5, 2022

When substituting the counter in a HOTP uri, the replacement string needs to be quoted because it contains a &. Quoting it will avoid & to be replaced with the matching portion of the pattern.

See:
https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html

Fixes #171

@fstecker
Copy link

@tadfisher is there any chance you could merge this soon? As long as this isn't fixed, pass-otp does not work with bash 5.2 (at least not for HOTP).

@GereonV
Copy link

GereonV commented Sep 21, 2024

Until @tadfisher gets around to merge this, one can disable patsub_replacement in shopt for bash.

This should set it up correctly:

if [[ -z "${BASH_ENV}" ]]; then
  export BASH_ENV=~/.bashenv
  echo "export BASH_ENV=~/.bashenv" >> ~/.bashrc
fi
echo "shopt -u patsub_replacement" >> "${BASH_ENV}"

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

Successfully merging this pull request may close these issues.

HOTP uri will be misformated since bash 5.2.2 on Fedora

4 participants