Skip to content

transaction: Expose PAM error types and test them all#12

Closed
3v1n0 wants to merge 6 commits intomsteinert:masterfrom
3v1n0:improved-errors
Closed

transaction: Expose PAM error types and test them all#12
3v1n0 wants to merge 6 commits intomsteinert:masterfrom
3v1n0:improved-errors

Conversation

@3v1n0
Copy link
Copy Markdown
Collaborator

@3v1n0 3v1n0 commented Sep 25, 2023

Use pam_debug.so to check if expected errors are returned, and provide a new error type

@3v1n0 3v1n0 force-pushed the improved-errors branch 4 times, most recently from 550b3ec to 5a2b9d1 Compare September 28, 2023 23:27
And use them instead of C ones. Given that we have strings for them we
can easily implement the error interface for it too.
@3v1n0 3v1n0 force-pushed the improved-errors branch 2 times, most recently from c4e91d9 to c748bf4 Compare September 29, 2023 17:20
Use pam_debug.so to generate pam configurations at test time and
check if the returned values expect the ones we want.
…error

If the transaction fails during start, there's no way to get the error
detail in a programmatic way, so let's inherit from error to allow more
per-type checks.
@3v1n0 3v1n0 force-pushed the improved-errors branch 3 times, most recently from 4331963 to d790098 Compare September 29, 2023 18:28
Transactions save the status of each operation in a status field, however
such field could be written concurrently by various operations, so we
need to be sure that:
 - We always return the status for the current operation
 - We store the status in a atomic way so that other actions won't
   create write races

In general, in a multi-thread operation one should not rely on
Transaction.Status() to get info about the last operation.
@3v1n0
Copy link
Copy Markdown
Collaborator Author

3v1n0 commented Oct 12, 2023

This is now part of #15 so let's close this.

@3v1n0 3v1n0 closed this Oct 12, 2023
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.

1 participant