Package: libnss-ldap
Version: 238-1
Followup-For: Bug #312284

Based on the original reporters information I've put together a patch
and verified that it does indeed work.  Please consider including this
in the next package version.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (400, 'testing'), (300, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-k7-ar
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages libnss-ldap depends on:
ii  debconf                    1.4.30.13     Debian configuration management sy
ii  libc6                      2.3.5-6       GNU C Library: Shared libraries an
ii  libkrb53                   1.3.6-2sarge2 MIT Kerberos runtime libraries
ii  libldap2                   2.1.30-8      OpenLDAP libraries

-- debconf information excluded
diff -Naur libnss-ldap-238.orig/debian/config libnss-ldap-238/debian/config
--- libnss-ldap-238.orig/debian/config  2005-09-06 17:09:25.000000000 -0600
+++ libnss-ldap-238/debian/config       2005-09-06 17:11:00.000000000 -0600
@@ -51,7 +51,7 @@
 # Tune in next time for the next episode of, configuring LDAP services..
 
 if(get("libnss-ldap/override") eq "true") {
-       read_and_input('shared/ldapns/ldap-server', 'host', 'critical');
+       read_and_input('shared/ldapns/ldap-server', 'uri', 'critical');
        read_and_input('shared/ldapns/base-dn', 'base', 'critical');
        read_and_input('shared/ldapns/ldap_version', 'ldap_version', 
'critical');
        $ret = go();  # yeah, we don't need that.. but in case we sometime do
diff -Naur libnss-ldap-238.orig/debian/libnss-ldap.postinst 
libnss-ldap-238/debian/libnss-ldap.postinst
--- libnss-ldap-238.orig/debian/libnss-ldap.postinst    2005-09-06 
17:09:25.000000000 -0600
+++ libnss-ldap-238/debian/libnss-ldap.postinst 2005-09-06 17:12:59.000000000 
-0600
@@ -35,7 +35,7 @@
                # i really need a better way to do this...
                # currently we replace only the first match, we need a better
                # way of dealing with multiple hits.
-               perl -i -p -e "s/$replacestring/$parameter $value/i 
+               perl -i -p -e "s-$replacestring-$parameter $value-i 
                        and \$match=1 if (\$match != 1)" $CONFFILE
        fi
 }
@@ -85,7 +85,8 @@
                        fi
 
                        db_get shared/ldapns/ldap-server
-                       change_value host "$RET"
+         disable_param host
+                       change_value uri "$RET"
 
                        db_get shared/ldapns/base-dn
                        change_value base "$RET"
diff -Naur libnss-ldap-238.orig/debian/templates 
libnss-ldap-238/debian/templates
--- libnss-ldap-238.orig/debian/templates       2005-09-06 17:09:25.000000000 
-0600
+++ libnss-ldap-238/debian/templates    2005-09-06 17:14:52.000000000 -0600
@@ -79,9 +79,11 @@
 
 Template: shared/ldapns/ldap-server
 Type: string
-_Default: 127.0.0.1
-_Description: LDAP server host address
- Please enter the address of the LDAP server used.
+_Default: ldap://127.0.0.1/
+_Description: LDAP server Uniform Resource Identifier
+ Please enter the URI of the LDAP server used. This is a string in the
+ form ldap://<hostname or IP>:<port>/ . ldaps:// or ldapi:// can also
+ be used. The port number is optional.
  .
  Note: It is usually a good idea to use an IP address; this reduces risks
  of failure in the event name service is unavailable.

Reply via email to