From ec9d5e18d2240ae881d4744606a29bcda31a1347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=D0=B8=D0=B9?= Date: Sun, 20 Jun 2021 17:04:32 +0300 Subject: [PATCH] Fixes with default rewrite and yad_error --- common.sh | 2 +- front_pwquality.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common.sh b/common.sh index fb2e7f6..ec30b47 100644 --- a/common.sh +++ b/common.sh @@ -118,6 +118,6 @@ _pw_parse_conf() { done < "${DESTDIR}/etc/security/pwquality.conf" } _yad_error() { - yad --form --image=dialog-error --text="Error" --title="Error" --field="$@:LBL" --button="yad-close:1" --width=100 --height=100 --scroll + yad --form --image=dialog-error --text="Error" --title="Error" --field="$(printf -- "$@")::TXT" --button="yad-close:1" --width=100 --height=100 return 1 } diff --git a/front_pwquality.sh b/front_pwquality.sh index 0209ba2..794af21 100644 --- a/front_pwquality.sh +++ b/front_pwquality.sh @@ -40,6 +40,8 @@ done _tag1="" _tag2="" +set +e + var="$(yad --title="linux-infosec-setupper: pwquality" --form \ --text-align=center \ --bool-fmt=T \ @@ -87,6 +89,8 @@ var="$(yad --title="linux-infosec-setupper: pwquality" --form \ --field=$"Status (local_users_only):CHK" "$local_users_only")" _status="$?" +set -e + # If we clicked on the "Load default" button, we decided to restore the settings. # The exit code after clicking on this button is 3. We restore the config if we clicked on this button if [ "$_status" == 3 ]; then