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 support for Apple Silicon and Big Sur #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

msanders
Copy link

@msanders msanders commented Feb 10, 2021

Partly taken from upstream in Reflejo#18.

It's necessary to create a universal binary to avoid the following error when a program running in Rosetta invokes sudo:

sudo: unable to initialize PAM: No such file or directory

Fixes #7.

Copy link

@sebastianludwig sebastianludwig left a comment

Choose a reason for hiding this comment

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

Verified that it works as intended on M1 and Big Sur 🚀

@joshmedeski
Copy link

It's also working for me on a Mac mini M1 (macOS Big Sur Version 11.2.3 (29D91) 🥳

Thanks @msanders!

@thebitstick
Copy link

This should get merged someday!

DESTINATION = /usr/local/lib/pam
TARGET = x86_64-apple-macosx10.15
TARGET = apple-darwin20.1.0

Choose a reason for hiding this comment

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

It may have to resolve the target value from the system:

TARGET = $(swift -version)

Is this enough to work across different chip sets?

@joshmedeski
Copy link

I had to update the TARGET for macOS 11.4

TARGET = apple-darwin20.5.0

I also had to manually add write permissions to the sudo file.

$ sudo chmod +w sudo

Then I was able to complete the install steps successfully:

  1. $ sudo make install
  2. Edit /etc/pam.d/sudo to include as the first line:
auth sufficient pam_watchid.so "reason=execute a command as root"

@myyra
Copy link

myyra commented Aug 6, 2021

I think the -target flag can be removed completely (as I understand it's set to the current platform by default). At least it worked fine for me.

@msanders
Copy link
Author

The target flag is required to make a universal binary so it can work under Rosetta. You can reproduce the above error with:

arch -x86_64 sudo echo

@joshmedeski
Copy link

The latest version of macOS, Version 11.6 (20G165) works when you follow my instructions above and replace the target with this:

TARGET = apple-darwin20.6.0

jnooree added a commit to jnooree/pam-watchid that referenced this pull request Nov 7, 2022
jnooree added a commit to jnooree/pam-watchid that referenced this pull request Nov 7, 2022
jnooree added a commit to jnooree/pam-watchid that referenced this pull request Nov 7, 2022
Partially supersedes biscuitehh#20.

Closes biscuitehh#15.
Resolves biscuitehh#7, resolves biscuitehh#14,
resolves biscuitehh#16, resolves biscuitehh#17.
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.

Doesn't work on new macOS big sur
5 participants