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.
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".
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.
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
(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.
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).
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)