From 5a6fe5ecc6e003141c929ea8a98ddffe62391fee Mon Sep 17 00:00:00 2001 From: Michel Decima Date: Wed, 18 Jan 2023 11:46:42 +0100 Subject: [PATCH] chore: use drop-in fragment for pwquality.conf Solves issue #6 --- debian/postinst | 23 ---------------------- etc/security/pwquality.conf.d/yourdev.conf | 15 ++++++++++++++ 2 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 etc/security/pwquality.conf.d/yourdev.conf diff --git a/debian/postinst b/debian/postinst index ab94940..e85e9c1 100644 --- a/debian/postinst +++ b/debian/postinst @@ -3,14 +3,6 @@ set -e -CONF_FILE="/etc/security/pwquality.conf" - -yd_update_keyval() { # file key value... - local file="$1" key="$2" ; shift 2 - # delete line starting with key then append to the end - sed -e "/^[ \t]*$key[ \t]\=/d" -e "\$a$key = $*" -i "$file" -} - case "$1" in configure) # Enable GDM customization @@ -65,21 +57,6 @@ case "$1" in ;; esac -# Min size of password -yd_update_keyval "$CONF_FILE" "minlen" "10" - -# Lowercase char (-1 => min 1 char) -yd_update_keyval "$CONF_FILE" "lcredit" "-1" - -# Uppercase char (-1 => min 1 char) -yd_update_keyval "$CONF_FILE" "ucredit" "-1" - -# Decimal char (-1 => min 1 char) -yd_update_keyval "$CONF_FILE" "dcredit" "-1" - -# Other char (-1 => min 1 char) -yd_update_keyval "$CONF_FILE" "ocredit" "-1" - # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. diff --git a/etc/security/pwquality.conf.d/yourdev.conf b/etc/security/pwquality.conf.d/yourdev.conf new file mode 100644 index 0000000..0e2e6ac --- /dev/null +++ b/etc/security/pwquality.conf.d/yourdev.conf @@ -0,0 +1,15 @@ +# Min size of password +minlen = 10 + +# Lowercase char (-1 => min 1 char) +lcredit = -1 + +# Uppercase char (-1 => min 1 char) +ucredit = -1 + +# Decimal char (-1 => min 1 char) +dcredit = -1 + +# Other char (-1 => min 1 char) +ocredit = -1 +