Password function

This commit is contained in:
2018-04-01 01:53:41 +02:00
parent 721f63774c
commit b31cc5948b
19 changed files with 773 additions and 254 deletions

View File

@ -1,3 +1,8 @@
PREFIX = /usr/local/bin
PPASSPATH = /var/lib/pam_panic
PPASSFILE = $(PPASSPATH)/auth
POSSIBLE_PAMDIRS = /lib/x86_64-linux-gnu/security /lib/security
PAMDIR = $(shell make detect_pamdir)
MANDIR = /usr/share/man
@ -7,10 +12,11 @@ all:
@which poweroff >/dev/null
@which cryptsetup >/dev/null
mkdir -p build obj
make -C src
make -C src -e "PPASSFILE = $(PPASSFILE)"
@printf "Done!\n"
clean:
rm build/pam_panic.so
rm build/pam_panic_pw
rm obj/pam_panic.o
rmdir build obj
@printf "Done!\n"
@ -18,15 +24,24 @@ clean:
detect_pamdir:
@for d in $(POSSIBLE_PAMDIRS); do if [ ! -d $${d} ]; then continue; else printf "$${d}\n"; fi; done
purge:
rm /var/lib/pam_panic/*
rmdir /var/lib/pam_panic
@printf "Done!\n"
uninstall:
PAMDIR=$(PAMDIR); rm $${PAMDIR}/pam_panic.so
rm /usr/share/man/*/pam_panic.8.gz
rm /usr/share/man/*/pam_panic_pw.1.gz
rm $(PREFIX)/pam_panic_pw
@printf "Done!\n"
install:
PAMDIR=$(PAMDIR); if [ -z $${PAMDIR} ]; then printf "Error: PAM's shared object directory was not detected. If you know where it is, please add to POSSIBLE_PAMDIRS and make a pull request.\n"&& exit 1; else cp build/pam_panic.so $${PAMDIR}/pam_panic.so; fi
if [ ! -d $(MANDIR) ]; then printf "Error: Where is the manpage directory?\n" && exit 1; else make install -C man -e "MANDIR = $(MANDIR)"; fi
mkdir -p $(PPASSPATH)
cp build/pam_panic_pw $(PREFIX)/pam_panic_pw
@printf "Done!\n"
test:
@printf "We only can test it in production.\n"
@printf "We only can test it in production, yet.\n"