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

bugfix - Prevent passwordstore lookup to create subkey when create == false #9106

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mluzarreta
Copy link
Contributor

SUMMARY

Prevent passwordstore lookup to create subkey when create == false
Fixes #9105

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

passwordstore lookup

@ansibullbot ansibullbot added bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type) labels Nov 7, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-10 Automatically create a backport for the stable-10 branch backport-9 Automatically create a backport for the stable-9 branch labels Nov 7, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've added a first comment below.

@felixfontein
Copy link
Collaborator

CC @mluzarreta

…en-when-create-==-false.yml

Co-authored-by: Felix Fontein <[email protected]>
@mluzarreta
Copy link
Contributor Author

Suggestions applied @felixfontein

result.append(self.update_password())
if self.paramvals["subkey"] != "password" and not self.passdict.get(self.paramvals['subkey']): # password exists but not the subkey
with self.opt_lock('write'):
result.append(self.update_password())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether this is correct. Right before the if, you're already running result.append(self.update_password()), and now, under a certain condition, you run it a second time.

@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch backport-10 Automatically create a backport for the stable-10 branch bug This issue/PR relates to a bug check-before-release PR will be looked at again shortly before release and merged if possible. lookup lookup plugin plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passwordstore lookup creates subkeys even when create==false and subkey does not exist
3 participants