Bug 127009 - autofs incorrectly parses smbfs (and cifs) mount points on the mount map
Summary: autofs incorrectly parses smbfs (and cifs) mount points on the mount map
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: autofs
Version: 2
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chris Feist
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-06-30 16:57 UTC by Alexei Dets
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-04-13 15:35:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Logs of mount attempt with ":" in share name (9.05 KB, text/plain)
2004-06-30 17:01 UTC, Alexei Dets
no flags Details
Logs of mount attempt without ":" in share name (3.21 KB, text/plain)
2004-06-30 17:02 UTC, Alexei Dets
no flags Details
Patch to allow mounting of samba shares without colon (418 bytes, patch)
2004-06-30 19:02 UTC, Alexei Dets
no flags Details | Diff

Description Alexei Dets 2004-06-30 16:57:42 UTC
From Bugzilla Helper: 
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.2; Linux) (KHTML, 
like Gecko) 
 
Description of problem: 
I've created a simple "program" map for samba shares, very much the 
same as for NFS: 
 
# cat /etc/auto.smb 
#!/bin/sh 
 
key="$1" 
smb_auth="/etc/samba/dets.auth" 
smb_opts="-fstype=smbfs,nonstrict,credentials=$smb_auth" 
 
smbclient -L $key -A $smb_auth 2>/dev/null | grep Disk | grep -v '\$' 
| sort +0 | \ 
        awk -v key="$key" -v opts="$smb_opts" -- ' 
        BEGIN           { ORS=""; first=1 } 
                        { if (first) { print opts; first=0 }; print " 
\\\n\t/" $1, "://" key "/" $1 } 
        END             { if (!first) print "\n"; else exit 1 } 
        ' 
 
For example, on host "monacan" this map produces the following 
output: 
# ./auto.smb monacan 
-fstype=smbfs,nonstrict,credentials=/etc/samba/dets.auth \ 
        /dets ://monacan/dets \ 
        /public ://monacan/public 
 
However, this doesn't work as expected: 
$ ls -l /smb/monacan 
ls: /smb/monacan: No such file or directory 
 
Log attached (mount_with_colon.txt) 
 
Probably this is the problem: 
dequote("://monacan/dets") -> ://monacan/dets 
I think to work without the problem it should be: 
dequote("://monacan/dets") -> //monacan/dets 
 
(":" should be removed). 
 
On the other hand, in the Internet are some examples (i.e. 
http://www.greenfly.org/tips/autofs.html) of a bit different syntax 
for automount map, without a colon: 
# ./auto.smb monacan 
-fstype=smbfs,nonstrict,credentials=/etc/samba/dets.auth \ 
        /dets //monacan/dets \ 
        /public //monacan/public 
 
After such change (that is AGAINST the documentated in the man pages) 
mounting doesn't work either. 
 
Log attached (mount_without_colon.txt) 
 
In this case parsing of the mount is completely broken, autofs 
doesn't see different shares, treats them as one... :-( 
 
Version-Release number of selected component (if applicable): 
autofs-4.1.2-2 
 
How reproducible: 
Always 
 
Steps to Reproduce: 
1. Create provided /etc/auto.smb script. 
2. mkdir /smb 
3. add "/smb    /etc/auto.smb  --timeout=60" to /etc/auto.master 
4. service autofs restart 
5. ls -l /smb/<your samba host> 
 
 
Expected Results:  I think that automount is expected to mount samba 
shares given the first syntax (with ":"). Or with second, but in this 
case man pages should be fixed. Anyway, one or both of this methods 
should work...

Comment 1 Alexei Dets 2004-06-30 17:01:43 UTC
Created attachment 101540 [details]
Logs of mount attempt with ":" in share name

Comment 2 Alexei Dets 2004-06-30 17:02:46 UTC
Created attachment 101541 [details]
Logs of mount attempt without ":" in share name

Comment 3 Alexei Dets 2004-06-30 19:02:10 UTC
Created attachment 101542 [details]
Patch to allow mounting of samba shares without colon

I'm providing a small patch that allows mounting of samba shares if they are
given in multimount map in format _without_ colon (as an examples in Internet)
simply because it is simplier and should not break anything (I've tested with
nfs & smbfs mounts). Patch to allow mounting in format described in man ("If
the filesystem to be mounted begins with a / (such as local /dev entries or
smbfs shares) a : needs to be prefixed (e.g. :/dev/sda1).") will be a bit more
complex - it seems to me that such functionality is completely broken in
modules/parse_sun.c and never actually worked.

Comment 4 Jeff Moyer 2004-07-07 15:57:33 UTC
I don't know why the qa contact was removed.

Comment 5 Chris Feist 2005-04-13 15:35:33 UTC
This should be fixed in the latest available fc3 update (autofs-4.1.3-114). 
Please reopen this bug if this is not the case.


Note You need to log in before you can comment on or make changes to this bug.