[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Autofs auto.smb needs hack to not list print$



The distro version of auto.smb gets a list of shares
and tries to extract the disk shares with the
following code:

$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
}

The problem is that smb/cifs replies with the same
'type' code (Disk) for both hard drive shares and
printer drivers.  For example:

Domain=[DELL3000] OS=[Windows 5.1] Server=[Windows
2000 LAN Manager]
IPC|IPC$|Remote IPC
Disk|print$|Printer Drivers
Disk|C|
Printer|HPLJ4L|HP LaserJet 4L
Domain=[DELL3000] OS=[Windows 5.1] Server=[Windows
2000 LAN Manager]

The attempt to mount //HOSTNAME/print always fails and
generates error messages:

Jun  8 12:30:29 EMACH433 automount[23139]:
mount(generic): calling mkdir_path
/smb/DELL3000/print/print
Jun  8 12:30:29 EMACH433 automount[23139]:
mount(generic): calling mount -t cifs -s -o rw
//DELL3000/print/print /smb/DELL3000/print
Jun  8 12:30:29 EMACH433 automount[23139]: >> retrying
with upper case share name
Jun  8 12:30:29 EMACH433 automount[23139]: >> mount
error 6 = No such device or address
Jun  8 12:30:29 EMACH433 automount[23139]: >> Refer to
the mount.cifs(8) manual page (e.g.man mount.cifs)

If anybody has a hack to exclude 'print$' from the
list   
before building the argument list to automount it
would be greatly appreciated!  I'll try to work
something up as well.  Thanks!



Reply to: