diff --git a/Makefile b/Makefile index 10ed334..6bdd3c3 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,16 @@ endif all: $(LIBRARY_NAME) +clean: + rm $(LIBRARY_NAME) + $(LIBRARY_NAME): touchid-pam-extension.swift swiftc touchid-pam-extension.swift -o $(LIBRARY_NAME) -target $(TARGET) -emit-library install: $(LIBRARY_NAME) mkdir -p $(DESTINATION) install -b -o root -g wheel -m 444 $(LIBRARY_NAME) $(DESTINATION)/$(LIBRARY_NAME).$(VERSION) + +install-pam: + grep $(LIBRARY_NAME) /etc/pam.d/sudo >/dev/null || echo auth sufficient $(LIBRARY_NAME) | cat - /etc/pam.d/sudo | sudo tee /etc/pam.d/sudo > /dev/null + grep $(LIBRARY_NAME) /etc/pam.d/su >/dev/null || echo auth sufficient $(LIBRARY_NAME) | cat - /etc/pam.d/su | sudo tee /etc/pam.d/su > /dev/null diff --git a/README.md b/README.md index c0129a4..5c7599a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,4 @@ Installation ------------ 1. `$ sudo make install` -2. Edit `/etc/pam.d/sudo` to include as the first line: `auth sufficient pam_touchid.so "reason=execute a command as root"` - -_Note that you might have other `auth`, don't remove them._ +2. `$ sudo make pam-install`