Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 385113

Summary: net-fs/autofs-5: automount map directory is '/etc' instead of '/etc/autofs'
Product: Gentoo Linux Reporter: Alberto Casari <albe.casari>
Component: Current packagesAssignee: Peter Volkov (RETIRED) <pva>
Status: RESOLVED FIXED    
Severity: normal CC: DuPol, net-fs
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
Build log without '/etc/autofs' directory
Build log with '/etc/autofs' directory
Patch to autofs-5.0.6-r3.ebuild

Description Alberto Casari 2011-09-30 17:56:10 UTC
Automount map files should be installed in '/etc/autofs' directory
instead of '/etc' since 'auto.master' is installed there(see 'ebuild').

Reproducible: Always

Steps to Reproduce:
1.emerge 'net-fs/autofs-5.0.6-r2'
2.
3.
Actual Results:  
/etc/autofs/auto.master
/etc/auto.misc
/etc/auto.net
/etc/auto.smb
/etc/autofs_ldap_auth.conf

Expected Results:  
/etc/autofs/auto.master
/etc/autofs/auto.misc
/etc/autofs/auto.net
/etc/autofs/auto.smb
/etc/autofs/autofs_ldap_auth.conf

Add '--with-mapdir=/etc/autofs' to 'econf' resolves the issue.
Comment 1 Dustin Polke 2011-10-05 11:52:19 UTC
Please attach full build.log and post your emerge --info
Comment 2 Alberto Casari 2011-10-05 16:08:28 UTC
Created attachment 288871 [details]
emerge --info

This is the 'emerge --info' you requested
Comment 3 Alberto Casari 2011-10-05 16:17:26 UTC
Created attachment 288873 [details]
Build log without '/etc/autofs' directory

Build log _without_ '/etc/autofs' directory
Comment 4 Alberto Casari 2011-10-05 16:24:29 UTC
Created attachment 288875 [details]
Build log with '/etc/autofs' directory

This is the build log _with_ '/etc/autofs' directory,
and this is a macro passed to 'gcc':
-DAUTOFS_MAP_DIR=\"/etc/autofs\"

And this is the build log _without_ '/etc/autofs' directory,
for instance when you install 'autofs' for the first time,
and this is a macro passed to 'gcc':
-DAUTOFS_MAP_DIR=\"/etc\"
Comment 5 Dustin Polke 2011-10-05 16:31:32 UTC
Peter,

this issue seems to be similar to bug #361481.
I can't figure out why this behaves differently on similar machines, but safest
way is to specify the correct dir by adding '--with-mapdir=/etc/autofs' to
econf as proposed by albecasari.

Should we add an elog message as well to get users attention in case they need
to migrate misplaced config files (I don't know if autofs even worked with such
a configuration...)?
Comment 6 Dustin Polke 2011-10-14 09:40:54 UTC
Created attachment 289785 [details, diff]
Patch to autofs-5.0.6-r3.ebuild

Peter,
if you want to add a elog message as well, please let me know. I will then come up with something.
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2011-10-14 20:14:44 UTC
Dustin, ./aclocal.m4 has following function:

dnl Check the location of the autofs maps directory
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_MAP_D,
[if test -z "$mapdir"; then
  for map_d in /etc/autofs /etc; do
    if test -z "$mapdir"; then
      if test -d "$map_d"; then
        mapdir="$map_d"
      fi
    fi
  done
fi])

Thus if /etc/autofs exists files will go there (and it does not exist on new installations). So the fix is correct. Commited into 5.0.6-r4. Thank you guys.