Bug 9228 - mount with //10.1.9.55/c$ doesn't work, with //10.1.9.55\\c$ works
Summary: mount with //10.1.9.55/c$ doesn't work, with //10.1.9.55\\c$ works
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: CIFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Steve French
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-26 01:24 UTC by Peter Hanzel
Modified: 2007-10-31 19:14 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.23.1
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
patch to parse UNC string with forward slashes (4.32 KB, patch)
2007-10-30 06:49 UTC, Shirish Pargaonkar
Details | Diff

Description Peter Hanzel 2007-10-26 01:24:24 UTC
Most recent kernel where this bug did not occur: 2.6.22.5
Distribution: LFS
Hardware Environment: VMWare on x86
Software Environment: LFS
Problem Description:
When I try to mount windows share with this command:
  mount -t cifs -o username=xx,password=xx //10.1.9.55/c$ /mnt/d
it doesn't work.

If i use:
  mount -t cifs -o username=xx,password=xx //10.1.9.55\\c$ /mnt/d
it works.

Comment from cifs\netmisc.c

int cifs_inet_pton(int address_family, char *cp, void *dst)
{
	int ret = 0;

	/* calculate length by finding first slash or NULL */
	/* BB Should we convert '/' slash to '\' here since it seems already
	 * done before this */ 

So before it was converted, but now not.


Steps to reproduce:
Comment 1 Andrew Morton 2007-10-26 01:39:48 UTC
umm, yeah, Steve, we shouldn't have done that?
Comment 2 Steve French 2007-10-26 07:57:38 UTC
This should only happen if you are missing the CIFS mount helper.  

Are you using mount.cifs (ie mount.cifs should typically be in /sbin and thus automatically invoked by mount command)?

The only thing I see that changed was to add the IPv6 address parsing in April - perhaps due to that the parsing changed for / (since IPv6 addresses allow more characters).  I will take a look
Comment 3 Shirish Pargaonkar 2007-10-26 08:47:16 UTC
cifstest4:~ # uname -r
2.6.23-g44093ca2-dirty

cifstest4:~ # mount -t cifs //cifstest1/public /mnt1 -o cifsacl,sfu,user=Administrator
Password:

cifstest4:~ # mount
/dev/sda1 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda2 on /boot type ext2 (rw,acl,user_xattr)
//cifstest1/public on /mnt1 type cifs (rw,mand)

I could mount. What am I missing, something obvious?
Comment 4 Steve French 2007-10-26 09:02:11 UTC
mv /sbin/mount.cifs /sbin/mount.cifs.save
then try the mount and you should see the failure)
(then remember to move /sbin/mount.cifs back)

Although the cifs mount helper is not absolutely required - I would expect it to be installed on general purpose workstations although there is sometimes packaging confusion with it being packaged with samba client rather than kernel on some distributions.
Comment 5 Shirish Pargaonkar 2007-10-26 12:15:27 UTC
cifs_parse_mount_options in netmisc.c problem.  Looking at it.
Comment 6 Shirish Pargaonkar 2007-10-30 06:49:06 UTC
Created attachment 13336 [details]
patch to parse UNC string with forward slashes

Code from the most current git tree linux/kernel/git/sfrench/cifs-2.6.git
Comment 7 Steve French 2007-10-31 19:14:14 UTC
Fix:

http://git.kernel.org/?p=linux/kernel/git/sfrench/cifs-2.6.git;a=commitdiff;h=1fb64bfc45b9ee5092b72474a5df216b8a0c7ff9

If this checks out ok, will request a merge with mainline.

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