From ccddfe65c13b3daa76898f09a04d2334ecda5eb6 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 09:29:46 +0300 Subject: [PATCH 1/2] Add example to pw cli frontend --- front_pwquality_cli.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/front_pwquality_cli.sh b/front_pwquality_cli.sh index bf9b558..1840616 100644 --- a/front_pwquality_cli.sh +++ b/front_pwquality_cli.sh @@ -34,6 +34,8 @@ fi case "$1" in -h|--help|h|help) echo $"Usage: #NAME# --[OPTIONS...]" +echo $" example: #NAME# --difok 6" +echo $" example: #NAME# d 6" echo $"#NAME# allows you to manage the file configuration for pwquality in the cli option. A GUI version is also available: #NAME2#" echo '' echo $" Options:" From b750aa84612d13c2a3bb97fcd0267cad5e05df11 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 09:37:05 +0300 Subject: [PATCH 2/2] add parse_pwquality.sh --- front_pwquality.sh | 4 ++-- parse_pwquality.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 parse_pwquality.sh diff --git a/front_pwquality.sh b/front_pwquality.sh index 7beaaac..3a1a1a4 100644 --- a/front_pwquality.sh +++ b/front_pwquality.sh @@ -32,8 +32,8 @@ var="$(yad --title=$"linux-infosec-setupper" --form \ --width=800 \ --height=800 \ --button=$"Load defaults!view-refresh:3" --button=$"yad-save:0" --button=$"yad-close:1" \ - --field=$"Number of characters in the new password that must not be present in the old password::LBL" "!" \ - --field=$"Value (difok)::NUM" "$difok!1..9999!1" \ + --field=$"Number of characters in the new password that must not be present in the old password::LBL" "!" \ + --field=$"Value (difok):NUM" "$difok!1..9999!1" \ --field=$"Minimum acceptable size for the new password:LBL" "!" \ --field=$"Value (minlen):NUM" "$minlen!6..9999!1" \ --field=$"The maximum credit for having digits in the new password::LBL" "!" \ diff --git a/parse_pwquality.sh b/parse_pwquality.sh new file mode 100755 index 0000000..d03a3f6 --- /dev/null +++ b/parse_pwquality.sh @@ -0,0 +1,8 @@ +_pw_parse_conf() { +while read -r line; do + case "$line" in + *=*) echo "${line// /}" ;; + *) echo "${line}=1" ;; + esac +done < "${DESTDIR}/etc/security/pwquality.conf" +}