I believe I found the problem, which is that parsesys() replaces the
debconf value with the output from 'hostname --domain'. Here is an
untested draft patch to solve it. It check if the current debconf
value is empty or the same as in the template, and only try to gess
the domain name if it is.
Index: debian/libnss-ldapd.config
===================================================================
--- debian/libnss-ldapd.config (revision 676)
+++ debian/libnss-ldapd.config (working copy)
@@ -23,16 +23,22 @@
# reasonable defaults
parsesys()
{
- # guess domain based on system information
- domain=`hostname --domain` || true
- [ -z "$domain" ] && domain=`hostname --nis | grep '\.'` || true
- [ -z "$domain" ] && domain=`hostname --fqdn | sed -n 's/^[^.]*\.//p'` || true
- [ -z "$domain" ] && domain=`sed -n 's/^ *\(domain\|search\) *\([^ ]*\)
*$/\2/p' /etc/resolv.conf | head -n 1` || true
- if [ -n "$domain" ]
+ db_get libnss-ldapd/ldap-base
+ searchbase="$RET"
+ # Empty or identical to the example setting present in the debconf template
+ if [ -z "$searchbase" ] || [ "dc=example,dc=net" = "$searchbase" ]
then
- # set search base
- searchbase=`echo "$domain" | sed 's/^/dc=/;s/\./,dc=/'` || true
- db_set libnss-ldapd/ldap-base "$searchbase"
+ # guess domain based on system information
+ domain=`hostname --domain` || true
+ [ -z "$domain" ] && domain=`hostname --nis | grep '\.'` || true
+ [ -z "$domain" ] && domain=`hostname --fqdn | sed -n 's/^[^.]*\.//p'` ||
true
+ [ -z "$domain" ] && domain=`sed -n 's/^ *\(domain\|search\) *\([^ ]*\)
*$/\2/p' /etc/resolv.conf | head -n 1` || true
+ if [ -n "$domain" ]
+ then
+ # set search base
+ searchbase=`echo "$domain" | sed 's/^/dc=/;s/\./,dc=/'` || true
+ db_set libnss-ldapd/ldap-base "$searchbase"
+ fi
fi
# guess ldap server
server=`getent hosts ldap` || true
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]