Bug 127009 - autofs incorrectly parses smbfs (and cifs) mount points on the mount map
autofs incorrectly parses smbfs (and cifs) mount points on the mount map
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Feist
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-30 12:57 EDT by Alexei Dets
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-13 11:35:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Alexei Dets 2004-06-30 12:57:42 EDT
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 13:01:43 EDT
Created attachment 101540 [details]
Logs of mount attempt with ":" in share name
Comment 2 Alexei Dets 2004-06-30 13:02:46 EDT
Created attachment 101541 [details]
Logs of mount attempt without ":" in share name
Comment 3 Alexei Dets 2004-06-30 15:02:10 EDT
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 Jeffrey Moyer 2004-07-07 11:57:33 EDT
I don't know why the qa contact was removed.
Comment 5 Chris Feist 2005-04-13 11:35:33 EDT
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.