diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-11-07 18:08:53 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-11-07 18:08:53 +0100 |
commit | 1031fca2fba6168933ffc5de900b5e9db46c161e (patch) | |
tree | 25d4ba51ee5f900241c321e018c11b25a9030525 /debian | |
parent | 4b03a41e450adf7a3e983bdcee3ed159f9932d5b (diff) |
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
Diffstat (limited to 'debian')
-rw-r--r-- | debian/nslcd.postinst | 18 |
1 files changed, 7 insertions, 11 deletions
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 "" |