-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tags 502089 + patch
thanks

On Mon, 13 Oct 2008, Arthur de Jong wrote:
There seems to be a problem with the LDAPURI and LDAPBASE environment
variables that can be set from /etc/default/autofs. The problem is that
they don't end up in the automounter process any more (my guess is that
start-stop-daemon cleans the environment).

After some more digging the problem was in the init script. The place where the export was done was apparently in a subshell (probably started because the use of pipes throughout the script). The attached patch fixes the problem and ensures that the LDAPURI and LDAPBASE environment variables will be exported to any subprocess. A replacement for debian/patches/065_fix_master_map_in_ldap.dpatch is also attached.

- -- - -- arthur - [EMAIL PROTECTED] - http://people.debian.org/~adejong --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFI9E50VYan35+NCKcRAojJAKCSJK5op0YX3CKYuEQlNYCu9FB+vgCgxTlT
HIpCFUsYbAj0wHqLICyNgLI=
=I+TL
-----END PGP SIGNATURE-----
--- /etc/init.d/autofs.orig 2008-03-08 11:19:48.000000000 +0100
+++ /etc/init.d/autofs  2008-10-14 09:10:46.000000000 +0200
@@ -116,6 +116,10 @@
    daemonoptions="$daemonoptions --timeout=$TIMEOUT"
 fi

+# ensure that the LDAP settings are available to sub-processes
+[ ! -z $LDAPURI ] && export LDAPURI="$LDAPURI"
+[ ! -z $LDAPBASE ] && export LDAPBASE="$LDAPBASE"
+
 #
 # Check for all maps that are to be loaded
 #
@@ -185,8 +189,6 @@
 function getldapmounts()
 {
     if [ -x /usr/lib/autofs/autofs-ldap-auto-master ]; then
-   [ ! -z $LDAPURI ] && export LDAPURI="$LDAPURI"
-   [ ! -z $LDAPBASE ] && export LDAPBASE="$LDAPBASE"
         /usr/lib/autofs/autofs-ldap-auto-master 2> /dev/null
    /usr/lib/autofs/autofs-ldap-auto-master -m automountMap \
        -e automount -n ou -k cn -v automountInformation 2> /dev/null
#!/bin/sh /usr/share/dpatch/dpatch-run
## 065_fix_master_map_in_ldap.dpatch
##
## DP: No description.

@DPATCH@
diff -urNad autofs-4.1.4+debian~/samples/rc.autofs.in 
autofs-4.1.4+debian/samples/rc.autofs.in
--- autofs-4.1.4+debian~/samples/rc.autofs.in   2008-10-14 09:41:10.000000000 
+0200
+++ autofs-4.1.4+debian/samples/rc.autofs.in    2008-10-14 09:42:00.000000000 
+0200
@@ -106,6 +106,10 @@
    daemonoptions="$daemonoptions --timeout=$TIMEOUT"
 fi

+# ensure that the LDAP settings are available to sub-processes
+[ ! -z $LDAPURI ] && export LDAPURI="$LDAPURI"
+[ ! -z $LDAPBASE ] && export LDAPBASE="$LDAPBASE"
+
 #
 # Check for all maps that are to be loaded
 #
@@ -176,6 +180,8 @@
 {
     if [ -x @@autofslibdir@@/autofs-ldap-auto-master ]; then
         @@autofslibdir@@/autofs-ldap-auto-master 2> /dev/null
+   @@autofslibdir@@/autofs-ldap-auto-master -m automountMap \
+       -e automount -n ou -k cn -v automountInformation 2> /dev/null
     fi
 }

Reply via email to