lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1661 - debian/nss-pam-ldapd/trunk/debian

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1661 - debian/nss-pam-ldapd/trunk/debian



Author: arthur
Date: Fri Apr 27 09:40:00 2012
New Revision: 1661
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1661&view=revision

Log:
use the configuration file contents to determine the authentication type, not 
the debconf database (closes: #670133)

Modified:
   debian/nss-pam-ldapd/trunk/debian/changelog
   debian/nss-pam-ldapd/trunk/debian/nslcd.config
   debian/nss-pam-ldapd/trunk/debian/nslcd.templates

Modified: debian/nss-pam-ldapd/trunk/debian/changelog
==============================================================================
--- debian/nss-pam-ldapd/trunk/debian/changelog Fri Apr 27 09:37:38 2012        
(r1660)
+++ debian/nss-pam-ldapd/trunk/debian/changelog Fri Apr 27 09:40:00 2012        
(r1661)
@@ -1,3 +1,10 @@
+nss-pam-ldapd (0.8.7-2) UNRELEASED; urgency=low
+
+  * use the configuration file contents to determine the authentication
+    type, not the debconf database (closes: #670133)
+
+ -- Arthur de Jong <adejong@debian.org>  Fri, 27 Apr 2012 09:30:00 +0200
+
 nss-pam-ldapd (0.8.7-1) unstable; urgency=low
 
   * new upstream release:

Modified: debian/nss-pam-ldapd/trunk/debian/nslcd.config
==============================================================================
--- debian/nss-pam-ldapd/trunk/debian/nslcd.config      Fri Apr 27 09:37:38 
2012        (r1660)
+++ debian/nss-pam-ldapd/trunk/debian/nslcd.config      Fri Apr 27 09:40:00 
2012        (r1661)
@@ -213,6 +213,16 @@
 then
   # parse current configuration
   parsecfg "$CONFFILE"
+  # deduce auth-type from configuration file
+  if grep -qi '^sasl_mech[[:space:]]' "$CONFFILE"
+  then
+    db_set nslcd/ldap-auth-type "SASL"
+  elif grep -qi '^binddn[[:space:]]' "$CONFFILE"
+  then
+    db_set nslcd/ldap-auth-type "simple"
+  else
+    db_set nslcd/ldap-auth-type "none"
+  fi
 else
   # first match wins
   parsecfg /etc/libnss-ldap.conf
@@ -225,31 +235,30 @@
   [ -z "$RET" ] && db_set nslcd/ldap-uris "ldap://127.0.0.1/";
   db_get nslcd/ldap-base
   [ -z "$RET" ] && db_set nslcd/ldap-base "dc=example,dc=net"
+  # deduce auth-type from available information
+  db_get nslcd/ldap-auth-type
+  if [ -z "$RET" ]
+  then
+    db_get nslcd/ldap-sasl-mech
+    sasl_mech="$RET"
+    db_get nslcd/ldap-binddn
+    binddn="$RET"
+    if [ -n "$sasl_mech" ]
+    then
+      db_set nslcd/ldap-auth-type "SASL"
+    elif [ -n "$binddn" ]
+    then
+      db_set nslcd/ldap-auth-type "simple"
+    else
+      db_set nslcd/ldap-auth-type "none"
+    fi
+  fi
 fi
 
 # fallback for starttls option
 db_get nslcd/ldap-starttls
 [ -z "$RET" ] && db_set nslcd/ldap-starttls "false"
 
-# deduce auth-type from available information
-db_get nslcd/ldap-auth-type
-if [ -z "$RET" ]
-then
-  db_get nslcd/ldap-sasl-mech
-  sasl_mech="$RET"
-  db_get nslcd/ldap-binddn
-  binddn="$RET"
-  if [ -n "$sasl_mech" ]
-  then
-    db_set nslcd/ldap-auth-type "SASL"
-  elif [ -n "$binddn" ]
-  then
-    db_set nslcd/ldap-auth-type "simple"
-  else
-    db_set nslcd/ldap-auth-type "none"
-  fi
-fi
-
 #
 # This is the second part of the script. In this part the configurable
 # settings will be presented to the user for approval. The postinst

Modified: debian/nss-pam-ldapd/trunk/debian/nslcd.templates
==============================================================================
--- debian/nss-pam-ldapd/trunk/debian/nslcd.templates   Fri Apr 27 09:37:38 
2012        (r1660)
+++ debian/nss-pam-ldapd/trunk/debian/nslcd.templates   Fri Apr 27 09:40:00 
2012        (r1661)
@@ -21,7 +21,6 @@
 Template: nslcd/ldap-auth-type
 Type: select
 __Choices: none, simple, SASL
-Default: none
 _Description: LDAP authentication to use:
  Please choose what type of authentication the LDAP database should
  require (if any):
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/