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

passwordstore: Fix error detection for non-English locales #4219

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

grembo
Copy link
Contributor

@grembo grembo commented Feb 17, 2022

SUMMARY

The passwordstore lookup plugin depends on parsing GnuPG's
error messages in English language. As a result, detection of
a specific error failes when users set a different locale.

This change corrects this by setting the LANGUAGE environment
variable to C when invoking pass, as this only affects
gettext translations.

See
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

passwordstore
plugins/lookup/passwordstore

ADDITIONAL INFORMATION

Originally discussed in #4912

@ansibullbot ansibullbot added bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type) small_patch Hopefully easy to review labels Feb 17, 2022
@grembo grembo force-pushed the passwordstore-locale branch 2 times, most recently from 3325d23 to f5fe4f1 Compare February 17, 2022 20:16
The passwordstore lookup plugin depends on parsing GnuPG's
error messages in English language. As a result, detection of
a specific error failes when users set a different locale.

This change corrects this by setting the `LANGUAGE` environment
variable to `C` when invoking `pass`, as this only affects
gettext translations.

See
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html
@grembo grembo force-pushed the passwordstore-locale branch from f5fe4f1 to e066025 Compare February 17, 2022 20:17
@felixfontein felixfontein added backport-3 check-before-release PR will be looked at again shortly before release and merged if possible. labels Feb 17, 2022
@ansibullbot ansibullbot removed the small_patch Hopefully easy to review label Feb 17, 2022
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Feb 17, 2022
@felixfontein felixfontein merged commit 77a0c13 into ansible-collections:main Feb 17, 2022
@patchback
Copy link

patchback bot commented Feb 17, 2022

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/77a0c139c9c929fb08d3b9c7eb3409b08bdb6857/pr-4219

Backported as #4220

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@grembo thanks for your contribution!

patchback bot pushed a commit that referenced this pull request Feb 17, 2022
The passwordstore lookup plugin depends on parsing GnuPG's
error messages in English language. As a result, detection of
a specific error failes when users set a different locale.

This change corrects this by setting the `LANGUAGE` environment
variable to `C` when invoking `pass`, as this only affects
gettext translations.

See
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

(cherry picked from commit 77a0c13)
@patchback
Copy link

patchback bot commented Feb 17, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/77a0c139c9c929fb08d3b9c7eb3409b08bdb6857/pr-4219

Backported as #4221

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Feb 17, 2022
The passwordstore lookup plugin depends on parsing GnuPG's
error messages in English language. As a result, detection of
a specific error failes when users set a different locale.

This change corrects this by setting the `LANGUAGE` environment
variable to `C` when invoking `pass`, as this only affects
gettext translations.

See
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

(cherry picked from commit 77a0c13)
felixfontein pushed a commit that referenced this pull request Feb 17, 2022
…4220)

The passwordstore lookup plugin depends on parsing GnuPG's
error messages in English language. As a result, detection of
a specific error failes when users set a different locale.

This change corrects this by setting the `LANGUAGE` environment
variable to `C` when invoking `pass`, as this only affects
gettext translations.

See
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

(cherry picked from commit 77a0c13)

Co-authored-by: grembo <[email protected]>
felixfontein pushed a commit that referenced this pull request Feb 17, 2022
…4221)

The passwordstore lookup plugin depends on parsing GnuPG's
error messages in English language. As a result, detection of
a specific error failes when users set a different locale.

This change corrects this by setting the `LANGUAGE` environment
variable to `C` when invoking `pass`, as this only affects
gettext translations.

See
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

(cherry picked from commit 77a0c13)

Co-authored-by: grembo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants