Possible bug in mount.cifs

Greg Trounson gregt at maths.otago.ac.nz
Fri Dec 10 03:34:46 GMT 2004


Hi,

In order to mount a windows share as a non-root user, I have an entry in 
my /etc/fstab that looks like this:
//pat/NT\040Users /home/gregt/NT          cifs 
users,noauto,username=gregt,uid=gregt,gid=gregt   0 0

Every time I try to mount it (either as root or user gregt), I get the 
following:
"username specified with no parameter".
That's strange, I thought.  I do have a parameter for username.

After a bit of experimenting, I discovered that omitting the "users" 
directive fixes the problem, but then of course only root can mount the 
share.

After turning up nothing on Google, I dove into the code.

Line 323 of mount.cifs.c contains:
	if (strncmp(data, "user", 4) == 0) {
	...

Unfortunatly this returns positive for the "users" directive in fstab, 
which has no parameter.  This always results in the above error message.

Since the "users" directive cannot be done away with, I believe there 
should be a check to handle the case where that string is present.

The attached patch should do it:

Greg


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mount.cifs.c.diff
Type: text/x-patch
Size: 542 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20041210/dfb985fd/mount.cifs.c.bin


More information about the samba-technical mailing list