Bug 249909

Summary: Need to strip : for mount.cifs support.
Product: Red Hat Enterprise Linux 4 Reporter: Ray Van Dolson <rvandolson>
Component: autofsAssignee: Jeff Moyer <jmoyer>
Status: CLOSED ERRATA QA Contact: Brock Organ <borgan>
Severity: low Docs Contact:
Priority: low    
Version: 4.5CC: ikent, jlayton, sputhenp
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0702 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-24 19:51:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Strips out un-wanted colon
none
Modified spec file to use cifs patch.
none
auto.cifs none

Description Ray Van Dolson 2007-07-27 20:15:38 UTC
Description of problem:
Using a fstype of cifs fails with the automounter.

Version-Release number of selected component (if applicable):
autofs-4.1.3-199.3

How reproducible:
Always

Steps to Reproduce:
1. Either set up a custom auto.cifs file or set up an entry in auto.misc using
the cifs file type (instead of smbfs).
2. Attempt to mount.
  
Actual results:
Mounts fail.

Expected results:
Mounts should succeed.

Additional info:
This is the result of the ':' being left in the command passed to mount.cifs. 
There is a patch already being applied to resolve this for smbfs, and it is
trivial to resolve for cifs.  I will attach a patch.

cifs has proven to be much more reliable than smbfs which is why I am using it.

Comment 1 Ray Van Dolson 2007-07-27 20:16:49 UTC
Created attachment 160134 [details]
Strips out un-wanted colon

Comment 2 Ray Van Dolson 2007-07-27 20:17:49 UTC
Created attachment 160135 [details]
Modified spec file to use cifs patch.

spec file I used to include the cifs patch.

Comment 3 Jeff Moyer 2007-08-24 18:18:39 UTC
I'll take a look at this.  Thanks for the patch!

Comment 5 Jeff Moyer 2007-09-21 21:29:27 UTC
Ray,

Would you mind including the map entry that you used to test this patch?  There
are at least 2 ways that a share can be specified, and I want to make sure that
the case you use is covered.

Comment 6 Ray Van Dolson 2007-09-24 17:29:05 UTC
Jeff, some interesting results.  It had been a couple months since I originally
filed this so I'd forgotten a bunch of the details.  Here are results using an
entry in auto.misc:

cifs -fstype=cifs,username=rayXXXX,password=XXXXXX,domain=esri.com
://LEORAY-XP/Files

This entry appears to work fine via /misc/cifs even with stock version -199.3.

Where I run into problems is using an auto.cifs script which generates map
entries like this:

-fstype=cifs,file_mode=0644,dir_mode=0755,uid=root,gid=root,domain=esri.com,credentials=/etc/auto.cifs.credentials
\
         /Files ://LEORAY-XP/Files

This only works when using my patched version -199.4 which strips the : out.  I
will attach my auto.cifs file.  With -199.3, an strace of mount.cifs's output
tells me:

execve("/sbin/mount.cifs.real", ["/sbin/mount.cifs.real", "://LEORAY-XP/Files",
"/cifs/LEORAY-XP/Files", "-o",
"rw,file_mode=0644,dir_mode=0755,uid=0,gid=0,domain=esri.com,credentials=/etc/auto.cifs.credentials"],
[/* 24 vars */]) = 0
...
...
write(1, "mount error: could not find target server. TCP name ///LEORAY-XP/Files
not found  rc = 134526947\nNo ip address specified and hostname not found\n",
144) = 144

I will also note something else interesting and probably unrelated.  It does not
appear that "mount.cifs" makes use of the "domain" parameter inside a
credentials file.  However, smbclient does make use of "domain".  So I have to
provide it on the command line for mount.cifs.

Let me know if you need any additional information.

Comment 7 Ray Van Dolson 2007-09-24 17:30:49 UTC
Created attachment 204321 [details]
auto.cifs

Comment 8 Ray Van Dolson 2007-09-24 17:32:28 UTC
Word wrapping looks funky above. The maps should all be on one line except the
auto.cifs generated one which is line broken where the \ is.

Comment 9 Jeff Moyer 2007-09-24 17:36:15 UTC
This is really helpful information, thank you!  I'll see what I can work out.

Comment 10 RHEL Program Management 2007-11-29 04:17:07 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 11 Jeff Moyer 2008-01-02 19:33:20 UTC
A fix for this issue was built into autofs version 4.1.3-131.1.

Comment 12 Ray Van Dolson 2008-01-02 23:49:35 UTC
Do you mean 4.1.3-231.1?

Comment 13 Jeff Moyer 2008-01-03 14:09:04 UTC
(In reply to comment #12)
> Do you mean 4.1.3-231.1?

Yes!  Sorry about that!


Comment 14 Gregory Lee Bartholomew 2008-01-24 00:57:36 UTC
I'm having this exact problem (mount string works with file: but not with
program:), but my autofs version is newer than the supposedly patched 4.1.3-231.1.

[root@home etc]# rpm -q autofs
autofs-5.0.1-31.x86_64
[root@home etc]# uname -a
Linux home.cs.siue.edu 2.6.23.8-34.fc7 #1 SMP Thu Nov 22 20:39:56 EST 2007
x86_64 x86_64 x86_64 GNU/Linux
[root@home etc]# tail -n 1 /var/log/messages
Jan 23 18:44:39 home automount[7567]: parse_mount: parse(sun): failed to expand
map entry
[root@home etc]# cat /etc/auto.homes
#! /bin/bash

echo "-fstype=cifs,dom=campus.siue.edu,credentials=/home/gbartho/credentials.txt
://ebserver-11.ac.siue.edu/2\$"

exit 0
[root@home etc]# date
Wed Jan 23 18:51:27 CST 2008
[root@home etc]# 

Comment 15 Jeff Moyer 2008-01-24 14:17:49 UTC
(In reply to comment #14)
> I'm having this exact problem (mount string works with file: but not with
> program:), but my autofs version is newer than the supposedly patched 4.1.3-231.1.
> 
> [root@home etc]# rpm -q autofs
> autofs-5.0.1-31.x86_64

Are you running RHEL 4?  It certainly doesn't appear so.  You'll want to create
a new bug and file it against whichever distribution you are running (FC7?).


Comment 16 Gregory Lee Bartholomew 2008-01-24 16:01:53 UTC
Sorry, I thought hats and fedoras were made by the same people. I'll try to find
fedora's bugzilla.

Comment 17 Jeff Moyer 2008-01-24 16:10:27 UTC
(In reply to comment #16)
> Sorry, I thought hats and fedoras were made by the same people. I'll try to find
> fedora's bugzilla.

Oh, it's the same bugzilla, just a different "Product" tag.  So, you can still
go to http://bugzilla.redhat.com/, but instead of selecting "Red Hat Enterprise
Linux" on the "Enter a new bug" page, you would select Fedora.  Here, try this
link out:

  http://tinyurl.com/23tbw6

Just fill in the summary and problem description and click submit.

Cheers,

Jeff

Comment 18 Jeff Moyer 2008-01-24 16:37:56 UTC
(In reply to comment #16)
> Sorry, I thought hats and fedoras were made by the same people. I'll try to find
> fedora's bugzilla.

I went ahead and filed that bug for you:  bug #430113.

Cheers,

Jeff


Comment 21 Barry Donahue 2008-06-12 14:26:43 UTC
Verified by RHTS job #23575

Comment 22 Jeff Moyer 2008-06-17 19:59:47 UTC
I updated the test case to cover more cifs URLs and it fails.  The problem is
that we overwrite the colon used to denote the server port with a slash.  This
needs fixing.

Comment 24 Jeff Moyer 2008-06-24 13:53:03 UTC
The test case fails due to not escaping a colon as part of the CIFS url.  This
is not a bug introduced by this patch set, and should be worked-around using the
no-slashify-colons map option.  I'm setting this back to modified.

Comment 27 Barry Donahue 2008-06-25 19:14:38 UTC
Verified RHTS job #24346

Comment 29 errata-xmlrpc 2008-07-24 19:51:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0702.html