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

Add macOS support #6

Merged
merged 8 commits into from Aug 23, 2021
Merged

Add macOS support #6

merged 8 commits into from Aug 23, 2021

Conversation

cormacrelf
Copy link
Contributor

Fixes #5

As noted there, there is a bug where you can get a SIGSEGV when using this with sudo and hitting Ctrl-C. I don't know if this is macOS specific.

Needs documentation but basically add this to some /etc/pam.d file.

# sudo: auth account password session
auth       sufficient     pam_smartcard.so
auth       required       pam_opendirectory.so
# add this line here
auth       optional       pam_duress.so
account    required       pam_permit.so
password   required       pam_deny.so
session    required       pam_permit.so

The installer will copy the PAM module to /usr/local/lib/pam because /usr/lib/pam is not writable even with sudo with SIP enabled. I think that's what's happening anyway.

Includes a couple of incidental changes which I think are appropriate anyway:

  • Changes the binary installation path to /usr/local/bin
  • Various makefile improvements
  • Renames pam_duress.o to pam_duress.so
  • A format warning zapped

Copy link
Owner

@nuvious nuvious left a comment

Choose a reason for hiding this comment

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

Thanks again for your contribution! Updated the change log with an attribution statement and version file accordingly. Please double check the OSX compatibility from the latest main v1.1.1 to ensure the privilege escalation vulnerability (Issue 1) is resolved on OSX and/or the fix for it didn't break the OSX compatibility. If either is the case feel free to open up a new issue.

@nuvious nuvious merged commit 22c95c4 into nuvious:main Aug 23, 2021
@cormacrelf
Copy link
Contributor Author

It does fix it, yes.

pam-duress on  main took 1m2s ❯ sudo pam_test cormac
Password:
hello from duress, who am i? cormac

I will PR a make install fix for what happens when you overwrite the pam module without deleting it first. (Apple considers the binary has been modified and it fails code signature validation. This is a bit dumb but yeah. Classic problem and can really get in the way if it blocks you from using sudo! If anybody messes this up, reboot in single user mode and remove any offending lines from the pam.d files. If you can fix it without doing that, the permissions on the .so are not constrained enough.)

@cormacrelf cormacrelf mentioned this pull request Aug 24, 2021
@cormacrelf cormacrelf deleted the macos branch August 12, 2023 12:15
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.

[FR] macOS support?
2 participants