Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16320 - Autofs does not find LDAP mount lists
Summary: Autofs does not find LDAP mount lists
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Ryan Phillips (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-24 18:20 UTC by Michael Farnbach
Modified: 2004-12-08 23:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Adds autofs-ldap-auto-master and schema (autofs-ldap-master.patch,595 bytes, patch)
2004-12-06 23:27 UTC, Felipe Massia Pereira
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Farnbach 2003-02-24 18:20:23 UTC
Two computers...

Portage 2.0.46-r12 (default-x86-1.4, gcc-3.2.2, glibc-2.2.5-r4,2.3.1-r3)
=================================================================
System uname: 2.4.19-gentoo-r10 i686 AMD Athlon(TM) XP1800+
GENTOO_MIRRORS="http://www.ibiblio.org/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss apm mikmod nls qtmt svga X gpm libwww python esd oggvorbis cdr mmx
3dnow sse cups slp nvidia x dga opengl xv dvd encode gnome gtk gtk2 bonobo evo
gb gtkhtml -kde -arts -qt motif tcltk aalib imlib ncurses readline sdl lcms gif
jpeg png tiff gd avi mpeg quicktime scanner alsa xmms oggvorgis flash snmp pam
ssl crypt socks5 imap ldap tcpd mysql postgres mozilla pda spell truetype xml
xml2 pdflib plotutils tetex guile java perl slang libg++ berkdb odbc gdbm cdf
zlib sasl krb5"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -mcpu=athlon-xp -O3 -pipe"
CXXFLAGS="-march=athlon-xp -mcpu=athlon-xp -O3 -pipe"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"

and

Portage 2.0.46-r12 (default-x86-1.4, gcc-3.2.1, glibc-2.3.1-r2)
=================================================================
System uname: 2.4.20 i686 AMD Athlon(tm) Processor
GENTOO_MIRRORS="http://gentoo.oregonstate.edu/
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss 3dnow apm avi cups encode gif imlib java jpeg libg++ libwww mikmod
mmx motif mpeg ncurses nls oggvorbis opengl pdflib png qtmt quicktime sdl spell
svga truetype xml2 xmms xv zlib slang readline gpm tcpd ssl perl python -X -gtk
-gnome -alsa -arts -kde -qt krb5 kerberos sasl ldap pam crypt -gdbm berkdb
imap"COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-mcpu=athlon -march=athlon -O3 -pipe"
CXXFLAGS="-mcpu=athlon -march=athlon -O3 -pipe"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j4"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"

Neither can mount automount maps that are in LDAP. On some investigation I found
that the file referenced in the rc script
"/usr/lib/autofs/autofs-ldap-auto-master" does not exist. I find no reference in
the compilation that it is being disabled or erroring during compile.
Comment 1 Michael Farnbach 2003-02-25 19:32:53 UTC
I replaced the contents of the getldapmounts function with the following for the mean time...

if [ -x /usr/bin/ldapsearch ]
        ldapsearch -x "(&(ou=auto.master)(objectclass=automountmap))" "dn" | \
        grep "dn:.*ou=auto.master" > /dev/null 2>&1;
then
        ldapbase=`ldapsearch -x "(&(ou=auto.master)(objectclass=automountmap))"
"ou" \
                | grep "^dn:" | sed 's/^dn: ou=auto.master,\(.*\)/\1/' \
                | sed 's/ //g'`
        ldapsearch -u -x -b "ou=auto.master,$ldapbase"  \
                "(&(objectclass=automount)(cn=*))" -s one \
                | grep "^cn" \
                | sed 's/cn: \(.*\)/\1/' | (
                while read dir ; do
                        `/usr/sbin/automount $dir ldap $ldapbase`
                done
        )
fi
Comment 2 Laurent Goujon 2003-06-03 10:19:37 UTC
You can find the source of autofs-ldap-auto-master at this address : 
http://people.redhat.com/nalin/autofs with Redhat LDAP Schema for autofs 
Comment 3 K Cody 2004-10-13 23:46:19 UTC
On further investigation, both the 'autofs-ldap-auto-master' and 'autofs.schema' are part of the package source distribution, both in the 'scripts/' dir.

That reduces this to a short ebuild patch:

---BEGIN PATCH---
@@ -62,6 +62,17 @@

        exeinto /etc/init.d ; newexe ${FILESDIR}/autofs.rc8 autofs
        insinto /etc/conf.d ; newins ${FILESDIR}/autofs.confd autofs
+
+       use ldap && (
+
+               exeinto /usr/lib/autofs
+               newexe ${S}/samples/autofs-ldap-auto-master     autofs-ldap-auto-master
+
+               insinto /etc/openldap/schema
+               insopts -m 644
+               newins ${S}/samples/autofs.schema                       autofs.schema
+       )
+
 }

 pkg_postinst() {
----END PATCH----

No claims that this is the most graceful way to do this in an ebuild.
Comment 4 Felipe Massia Pereira 2004-12-06 23:27:51 UTC
Created attachment 45417 [details, diff]
Adds autofs-ldap-auto-master and schema

I'm just attaching this patch because copy/paste from page does not work very
well. Apply with 
  patch -p0 < patch-file
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-08 23:07:07 UTC
in autofs-4.1.3-r1.