Package: autofs
Version: 4.1.4-8
Severity: important

Hello there !

I have discovered autofs recently and it looks amazing to manage samba share.
So I have uncommented auto.smb in the auto.master file and tried lsing
/smb/myserver/ . Failure!

My file server is a Microsoft Windows 2000 system that require a username
and password to connect to.

I have patched the auto.smb file (see below) so it look for an optional
credential file that looks like /etc/auto.smb.<hostname> . I have a few
hosts so its easy for me. If the file doesnt exist, it just use the
old system.

Here is the full file (sorry I got no proper patch cause I forgot to backup
the original file).

--------------------8<-------------------------------------------------------
#!/bin/bash

# $Id: auto.smb,v 1.3 2005/04/05 13:02:09 raven Exp $

# This file must be executable to work! chmod 755!

key="$1"
credfile="/etc/auto.smb.$key"
mountopts="-fstype=smbfs"
smbclientopts=""

for P in /bin /sbin /usr/bin /usr/sbin
do
        if [ -x $P/smbclient ]
        then
                SMBCLIENT=$P/smbclient
                break
        fi
done

[ -x $SMBCLIENT ] || exit 1

if [ -e $credfile ]
then
        mountopts=$mountopts",credentials=$credfile"
        smbclientopts="-A "$credfile
else
        smbclientopts="-N"
fi

$SMBCLIENT $smbclientopts -gL $key 2>/dev/null| awk -v key="$key" -v 
opts="$mountopts" -F'|' -- '
        BEGIN   { ORS=""; first=1 }
        /Disk/  { if (first) { print opts; first=0 }; print " \\\n\t /" $2, 
"://" key "/" $2 }
        END     { if (!first) print "\n"; else exit 1 }
        '
--------------------8<-------------------------------------------------------


Then i created /etc/auto.smb.<hostname> which contain:

username = Someuser
password = Somepassword

Then a ll /smb/<hostname> gave me the files :p

Can you review it and eventually add it to the debian package ? Thanks!


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (99, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-k7
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages autofs depends on:
ii  libc6                         2.3.5-8    GNU C Library: Shared libraries an
ii  ucf                           2.004      Update Configuration File: preserv

Versions of packages autofs recommends:
pn  nfs-common                    <none>     (no description available)

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to