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

Investigate and document thread safety requirements #3

Open
tanriol opened this issue Mar 18, 2024 · 2 comments
Open

Investigate and document thread safety requirements #3

tanriol opened this issue Mar 18, 2024 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@tanriol
Copy link

tanriol commented Mar 18, 2024

According to pam(3)

The libpam interfaces are only thread-safe if each thread within
the multithreaded application uses its own PAM handle.

Looks to me like the current implementation either is unsound due to violating libpam thread-safety requirements or relies on some internal libpam implementation details for soundness.

@ChocolateLoverRaj
Copy link
Owner

Is it even possible to have each thread use its own PAM handle?

@ChocolateLoverRaj ChocolateLoverRaj added the help wanted Extra attention is needed label Mar 18, 2024
@ChocolateLoverRaj
Copy link
Owner

If unsafe_send.rs was deleted and the solution in #6 (comment) was implemented would it meet PAM's thread safety requirements?

Also PAM should've been written in Rust so we wouldn't have to read documentation and could just confidently write safe code as long as we didn't use the word unsafe in this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants