Build pam_panic_config with SECUREDIR

This commit is contained in:
Bandie 2018-11-03 01:50:17 +01:00
parent 3f371666f6
commit 69997ca7d3
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD
2 changed files with 11 additions and 2 deletions

View File

@ -1,2 +1,8 @@
SUBDIRS = applications icons
bin_SCRIPTS = pam_panic_config
%: %.prebuild
{ sldr=$$(echo "$(SECUREDIR)" | $(SED) 's/\//\\\//g'); $(SED) "s/__SECURELIBDIR__/$$sldr/" $< > $@ ; }
clean-local:
$(RM) *.tmp

View File

@ -8,6 +8,9 @@
CONFIGFILE="/etc/pam.d/pampanic"
LHBU="$HOME/LUKSHeaderBackup"
# Set on build time
SECUREDIR="__SECURELIBDIR__"
if [ $EUID -ne 0 ]; then
echo "Please run this script as root or using sudo."
exit 1
@ -230,7 +233,7 @@ power=$?
# Configuration generation
dialog --backtitle "pam_panic's Configuration Generator" \
--infobox "Generating configuration..." 3 40
config="#%PAM-1.0\nauth requisite pam_panic.so"
config="#%PAM-1.0\nauth requisite $SECUREDIR/pam_panic.so"
case $power in
"0")
@ -255,7 +258,7 @@ case $serious in
config="$config serious=$serious_dev"
;;
esac
config="$config\naccount requisite pam_panic.so"
config="$config\naccount requisite $SECUREDIR/pam_panic.so"
# Write config file