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

[PR #8689/8989b6c4 backport][stable-9] Namespace the passwordstore lockfile #8746

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Aug 12, 2024

This is a backport of PR #8689 as merged into main (8989b6c).

SUMMARY

When passwordstore needs to grab a lock, it creates a statically named file (within /tmp, typically). It also leaves that lock file around after it is done with it. This is unfortunate as there might be more than one user using the passwordstore functionality on a single machine, even if they aren't using it contemporaneously. Prepend the username to the filename so that the lock file is unique per user.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

passwordstore

ADDITIONAL INFORMATION
  1. run a playbook that will lookup from a passwordstore
  2. login as another user
  3. run the same or another playbook that will lookup from a passwordstore
  4. it errors out because the lockfile exists and cannot be removed (due to not being the owner of the file)

* Namespace the lockfile

When passwordstore needs to grab a lock, it creates a statically file (within /tmp, typically). This is unfortunate, when there might be more than one user using the passwordstore functionality on that machine. Prepend the user to the filename, to bypass further issues.

* Update plugins/lookup/passwordstore.py

specifically reference the argument number in the format string.

Co-authored-by: Felix Fontein <[email protected]>

* Add changelog fragment for PR#8689

* Update 8689-passwordstore-lock-naming.yml

I was sure that was a copy/paste.

* Update changelogs/fragments/8689-passwordstore-lock-naming.yml

specify the type of plugin

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 8989b6c)
@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type) labels Aug 12, 2024
@felixfontein felixfontein merged commit 176f6a6 into stable-9 Aug 12, 2024
146 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-9/8989b6c4d4b7588c7f0c97185fb18bb9bf9d08c2/pr-8689 branch August 12, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bug This issue/PR relates to a bug lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants