From 1031fca2fba6168933ffc5de900b5e9db46c161e Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 7 Nov 2010 17:08:53 +0000 Subject: move special casing of handling bindpw removal to cfg_disable() function git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1306 ef36b2f9-881f-0410-afb5-c4e39611909c --- debian/nslcd.postinst | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'debian') diff --git a/debian/nslcd.postinst b/debian/nslcd.postinst index e51cd5f..dee6893 100644 --- a/debian/nslcd.postinst +++ b/debian/nslcd.postinst @@ -45,6 +45,11 @@ cfg_set() cfg_disable() { parameter="$1" + # handle bindpw option specially by removing value from config first + if [ "$parameter" = "bindpw" ] && grep -i -q "^bindpw " $CONFFILE + then + cfg_set bindpw "*removed*" + fi # make matching of spaces better in parameter param_re=`echo "$parameter" | sed 's#^#[[:space:]]*#;s#[[:space:]][[:space:]]*#[[:space:]][[:space:]]*#g'` # lines to not match @@ -183,21 +188,12 @@ then then cfg_set bindpw "$RET" else - # no bindpw set - if grep -i -q "^bindpw " $CONFFILE - then - cfg_set bindpw "*removed*" - cfg_disable bindpw - fi + cfg_disable bindpw fi else # no binddn/pw, disable options cfg_disable binddn - if grep -i -q "^bindpw " $CONFFILE - then - cfg_set bindpw "*removed*" - cfg_disable bindpw - fi + cfg_disable bindpw fi # remove password from database db_set nslcd/ldap-bindpw "" -- cgit v1.2.3