From 3076028f4cb8f8df14ba5d5cac3a4fd8f4501bb7 Mon Sep 17 00:00:00 2001 From: Bandie Date: Sat, 3 Nov 2018 16:16:38 +0100 Subject: [PATCH 1/2] Prevent to run script which weren't "built" --- src/pam_panic_config/Makefile.am | 2 +- src/pam_panic_config/pam_panic_config.prebuild | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pam_panic_config/Makefile.am b/src/pam_panic_config/Makefile.am index 0fa7216..9224cc2 100644 --- a/src/pam_panic_config/Makefile.am +++ b/src/pam_panic_config/Makefile.am @@ -2,7 +2,7 @@ SUBDIRS = applications icons/48x48 icons/64x64 icons/scalable bin_SCRIPTS = pam_panic_config %: %.prebuild - { sldr=$$(echo "$(SECUREDIR)" | $(SED) 's/\//\\\//g'); $(SED) "s/__SECURELIBDIR__/$$sldr/" $< > $@ ; } + { sldr=$$(echo "$(SECUREDIR)" | $(SED) 's/\//\\\//g'); bdr=$$(echo "$(bindir)" | $(SED) 's/\//\\\//g'); $(SED) "s/__SECURELIBDIR__/$$sldr/;s/__PAMPANICPW__/$$bdr\/pam_panic_pw/" $< > $@ ; } clean-local: $(RM) *.tmp diff --git a/src/pam_panic_config/pam_panic_config.prebuild b/src/pam_panic_config/pam_panic_config.prebuild index ec1bf16..ab559bf 100755 --- a/src/pam_panic_config/pam_panic_config.prebuild +++ b/src/pam_panic_config/pam_panic_config.prebuild @@ -10,6 +10,9 @@ LHBU="$HOME/LUKSHeaderBackup" # Set on build time SECUREDIR="__SECURELIBDIR__" +PAMPANICPW="__PAMPANICPW__" + +[[ ! -d $SECUREDIR ]] || [[ ! -f $PAMPANICPW ]] && { echo "ERROR: Bash script was not build correctly." ; exit 1 ; } if [ $EUID -ne 0 ]; then echo "Please run this script as root or using sudo." @@ -174,7 +177,7 @@ while [ $auth_mode -eq 2 ]; do case $setpw in "0") clear - pam_panic_pw + $PAMPANICPW if [ $? -ne 0 ]; then clear echo "Failed to set a password. :(" From 41a8921178520836d35e2a069d810cb4d0e719b6 Mon Sep 17 00:00:00 2001 From: Bandie Date: Sat, 3 Nov 2018 16:43:49 +0100 Subject: [PATCH 2/2] Generate icons/scalable svg symlink to pixmaps dir (Unity compatible) --- configure.ac | 2 ++ src/pam_panic_config/icons/scalable/Makefile.am | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 2af0092..6e61cdb 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,8 @@ AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_USE_SYSTEM_EXTENSIONS +AC_PROG_LN_S +AC_PROG_MKDIR_P AC_PROG_CC CFLAGS+=" -std=gnu11" diff --git a/src/pam_panic_config/icons/scalable/Makefile.am b/src/pam_panic_config/icons/scalable/Makefile.am index fcad5e6..2e35548 100644 --- a/src/pam_panic_config/icons/scalable/Makefile.am +++ b/src/pam_panic_config/icons/scalable/Makefile.am @@ -1,2 +1,7 @@ appicondir=$(datadir)/icons/hicolor/scalable/apps appicon_DATA=pampanic.svg +pixmapsdir=$(datadir)/pixmaps + +install-exec-hook: + $(MKDIR_P) $(pixmapsdir) + $(LN_S) $(appicondir)/pampanic.svg $(pixmapsdir)/pampanic.svg