Package: libnss-ldap
Version: 238-1
Severity: important

When asked for the bindpw and giving a password which contains
a "/" (slash) the postinst fails with following message:

<snip>
Richte libnss-ldap ein (238-1) ...
Bareword found where operator expected at -e line 1, near "s/^# *bindpw
.*/bindpw
Ge/heim"
syntax error at -e line 1, near "s/^# *bindpw .*/bindpw Ge/heim"
Execution of -e aborted due to compilation errors.
dpkg: Fehler beim Bearbeiten von libnss-ldap (--configure):
Unterprozess post-installation script gab den Fehlerwert 255 zurück 
<snap>

The problem is, that a slash breaks the perl regex used to substitute
the values in /etc/libnss-ldap.conf.

The following patch for the postinst script solves my problem:

<snip>
--- libnss-ldap.postinst.orig   2005-12-01 10:24:36.000000000 +0100
+++ /var/lib/dpkg/info/libnss-ldap.postinst     2005-12-01
10:18:38.000000000 +0100
@@ -17,6 +17,10 @@
        parameter=$1
        value=$2
        commented=0 ; notthere=0
+
+       # make it compatible for regex
+       value=`echo $value | sed -s 's#/#\\\/#g'`
+
        egrep -i -q "^$parameter " $CONFFILE || notthere=1
        if [ "$notthere" = "1" ]; then
                if ( egrep -i -q "^# *$parameter" $CONFFILE ); then
<snap>

Any occuring slash in $value will be escaped by a backslash.
Perhaps its necessary to substitute more special characters.
Whats about a backslash in password? Think it has to be escaped to.



-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.11
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libnss-ldap depends on:
ii  debconf                    1.4.30.13     Debian configuration management sy
ii  libc6                      2.3.2.ds1-22  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

Reply via email to