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] Do not abort saving if the OTP counter is aborted #2775

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

dominikschulz
Copy link
Member

Fixes #2763

@dominikschulz dominikschulz added the bug Defects label Jan 19, 2024
@dominikschulz dominikschulz added this to the 1.15.12 milestone Jan 19, 2024
Copy link
Member

@AnomalRoil AnomalRoil left a comment

Choose a reason for hiding this comment

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

I think this should fix the problem.

Thoughts:

  • in the case reported in the issue, skip is going to be true because the --pasword flag is being passed to the OTP command, and so it would make the OTP function return causing its defered cancel() to be run, thus cancelling the queued gitCommitAndPush from here:
    // try to enqueue this task, if the queue is not available
    // it will return the task and we will execute it inline
    t := queue.GetQueue(ctx).Add(func(_ context.Context) (context.Context, error) {
    return nil, s.gitCommitAndPush(ctx, name)
    })

    because we're enqueuing the gitCommitAndPush and the OTP function finishes before the gitCommitAndPush queued operation has a chance to finish and sadly the context it's getting is the one that's cancelled.

So yeah, LGTM.

@AnomalRoil AnomalRoil merged commit 5a98a02 into gopasspw:master Jan 19, 2024
8 checks passed
@dominikschulz dominikschulz deleted the fix/issue-2763 branch January 22, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gopass otp gives git error
2 participants