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

Fix HOTP counter increases #172

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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