Bug 5118 - mount.cifs user mount bug
Summary: mount.cifs user mount bug
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: user space tools (show other bugs)
Version: 2.6
Hardware: x86 Linux
: P3 normal
Target Milestone: ---
Assignee: Steve French
QA Contact:
Depends on:
Reported: 2007-12-04 11:07 UTC by Jan Vojtech
Modified: 2009-08-24 18:10 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Vojtech 2007-12-04 11:07:37 UTC
When I write a link to some Windows network drive to /etc/fstab and I include "user" among options, I should be able to connect this drive as a regular user. But it isn't possible even I add a SUID to mount.cifs command. I checked the source and it seems there is a bug. When I omit certain passages in code and I recombile it, it works well for me, but these changes are lost with new versions of Samba (I have to replace the files again). I run Ubuntu 7.04, but I had the same problems on Fedora Core 6. 

Thank you for the replay.
Comment 1 Debian samba package maintainers (PUBLIC MAILING LIST) 2008-12-07 12:00:39 UTC
This bug is also described in Debian bug #403724

"user" is, in mount.cifs, a shortname for "username", so, indeed, using it means that one connects to the CIFS server as user.....unspecified.

The problem lies in the conflict between the "user" option which is a standard for mount options, to specify that ordinary users are allowed to mount a given recource.....and "user" neing a shortname for mount.cifs's "username" specific option.

I think it would be better for mount.cifs to *not* allow "user" as a shortname for "username".
Comment 2 shirishpargaonkar@gmail.com 2009-07-21 20:15:43 UTC
It is possible, there are existing /etc/fstab entries or scripts that have
been using user as a short for username mount option.
This change will definitely break them.
Comment 3 Steve French 2009-07-21 20:56:16 UTC
Not sure what is happening here - "user=myusername" and "user" (meaning a user mount) can be distinguished.   We accept either "user=" (not just "username=") because earlier operating systems (OS/2 e.g.) and more common OS (e.g. Windows) used "user" (not username) to specify the user on a mount.

Jeff Layton made some changes to mount.cifs to better handle user mounts, and IIRC they should still work - I thought that we could distinguish between these in mount.cifs still
Comment 4 shirishpargaonkar@gmail.com 2009-07-22 11:36:49 UTC
(In reply to comment #3)

user mounts work and user and user='<username>' do get distinguished
when specified in /etc/fstab entries.

It may be confusing to use user once to allow user mounts and 
then again to specify a user on the remote system as user=<username>
in an entry in /etc/fstab but I think cifs has to continue using 
mount option  user  in such ways in /etc/fstab.
Comment 5 Jeff Layton 2009-07-27 12:44:44 UTC
I suggest we close this as FIXED with the changes I made to the setuid behavior a month or so ago. It should work correctly now (assuming someone makes mount.cifs setuid root).
Comment 6 Steve French 2009-08-24 18:10:21 UTC
user mounts can now pick which behavior they want "forceuid" (default) or "noforceuid" depending on whether they want the uid (or gid) from the server for an inode to be used (vs. using a default uid or gid for the mount)