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

Fixed failures in PAM module #56

Merged
merged 5 commits into from
Sep 1, 2017
Merged

Fixed failures in PAM module #56

merged 5 commits into from
Sep 1, 2017

Conversation

josephlr
Copy link
Member

@josephlr josephlr commented Sep 1, 2017

This PR stops certain functionality from failing in the PAM module. This is mainly done by changing how we lookup the user keyring. We no longer user goroutines, which were part of the problem.

The PAM functions are now (mostly) insulated against panics making them crash. This fixes #53

Now the offending panic will just be logged and the module will fail.
This is important as to not crash the login process.
This was creating an issue becasuse fully dropping privileges required
spawning a goroutine and using rutime.DropOSThread().
Now instead of spawning a seperate thread we alternate between changing
the euid and ruid to both find the keyring and link it to the process
keyring. Note that we also ensure that the user keyring is linked into
the root keyring whenever possible.
Chaning the --user flag to (optionally) check for a proper keyring setup
allows us to fail early in cases where we need a working keyring.
Now the user is persented with help when they try to access a keyring
that isn't theirs or try to use fscrypt without a user keyring linked
into the session keyring.
@josephlr josephlr merged commit 0879b8f into master Sep 1, 2017
@josephlr josephlr deleted the panics branch September 1, 2017 10:01
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.

Insulate PAM module against panicking
1 participant