Support for uid and gid mount options for CIFS

Bug #48418 reported by Havard Bjastad
12
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned
linux-source-2.6.17 (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

When mounting a CIFS share from a server that has Linux Extensions enabled, the uid and gid options are not supported on Ubuntu. This can be achieved by putting "1" into /proc/fs/cifs/LinuxExtensionsEnabled, however this is not straightforward for the average user.
See http://lists.samba.org/archive/smb-clients/2005-May/000572.html for more info.

Note: the original reporter indicated the bug was in package 'samba-client'; however, that package was not published in Ubuntu.

Tags: cft-2.6.27
Revision history for this message
Sridhar Dhanapalan (sridhar) wrote :

I am using Edgy, and /proc/fs/cifs/LinuxExtensionsEnabled was already set to 1 with no intervention from me. Still, I don't have permissions to write to a cifs share, even after using the uid and gid options. I don't have this problem when using smbfs instead of cifs to mount the samba share.

Revision history for this message
Sridhar Dhanapalan (sridhar) wrote :

It appears that I am not the only one experiencing this problem: http://www.ubuntuforums.org/showthread.php?t=358072

Revision history for this message
Sridhar Dhanapalan (sridhar) wrote :

Contrarily (unless I'm misinterpreting the original report), I can get the uid and gid options to be properly recognised by putting 0 (not 1) into /proc/fs/cifs/LinuxExtensionsEnabled.

Revision history for this message
Sridhar Dhanapalan (sridhar) wrote :

While the above 'solution' does allow me to write to the share, it of course disallows distinctly UNIX things like symlinks. From what I can see, there is no way to read/write these things without having the same UID/GID as the owner on the server. This drastically limits the utility of CIFS, and in some cases removes the whole point of it entirely.

Revision history for this message
Ante Karamatić (ivoks) wrote :

Testing this on Gutsy:

$ cat /proc/fs/cifs/LinuxExtensionsEnabled
1
$ sudo mount -t cifs //localhost/test /mnt/ -o username=ivoks,uid=nobody,gid=nogroup
$ ls -dl /mnt/
drwxr-xr-x 2 nobody nogroup 0 2007-08-04 17:03 /mnt/
$ sudo umount /mnt/
$ sudo mount -t cifs //localhost/test /mnt/ -o username=ivoks,uid=root,gid=root
$ ls -dl /mnt/
drwxr-xr-x 2 root root 0 2007-08-04 17:03 /mnt/

Is that what you had in mind?

Changed in linux-source-2.6.17:
status: New → Triaged
Revision history for this message
Sridhar Dhanapalan (sridhar) wrote :

Ante, yes this is what I had in mind. I am not able to make the uid or gid options to work in Ubuntu 7.04. This problem is documented in the man page, but there doesn't appear to be a solution for it.

Revision history for this message
Ante Karamatić (ivoks) wrote :

Well, there is solution :) It's fixed in Gutsy. I'll try isolating diff for Feisty...

Revision history for this message
Sridhar Dhanapalan (sridhar) wrote :

The man page says that uid= and gid= are ignored by the cifs driver when connecting to a server that supports unix permissions. When you were testing, were you connecting to a windows or a *nix box? In my testing, I was trying to connect to a server running feisty, which does support the permissions and hence would ignore the uid= and gid= options. However, this is suboptimal and has caused much grief amongst users.

Also, if it's of any use, I've tried running the server as both security=user and security=share. There's no difference.

Thanks for your help :)

Revision history for this message
Ante Karamatić (ivoks) wrote : Re: [Bug 48418] Re: Support for uid and gid mount options for CIFS

Sridhar Dhanapalan wrote:

> The man page says that uid= and gid= are ignored by the cifs driver when
> connecting to a server that supports unix permissions. When you were
> testing, were you connecting to a windows or a *nix box? In my testing,
> I was trying to connect to a server running feisty, which does support
> the permissions and hence would ignore the uid= and gid= options.
> However, this is suboptimal and has caused much grief amongst users.

I was mounting gutsy share on gutsy client. It was all on localhost, and
worked with unix extensions enabled and disabled. It also worked if I
mounted on gutsy client from feisty server. If mounted with uid,gid,
permissions are set by client. If mounted without uid,gid, permissions
are set by server.

It didn't work when mounting on feisty client from gutsy or feisty
server - it took permissions of a share.

So, this is really fixed in gutsy and man page in gutsy should be
changed to note that uid and gid aren't ignored anymore.

Revision history for this message
Brian Murray (brian-murray) wrote :

I am assigning this bug to the 'ubuntu-kernel-team' per their bug policy. For future reference you can learn more about their bug policy at https://wiki.ubuntu.com/KernelTeamBugPolicies .

Changed in linux-source-2.6.17:
assignee: nobody → ubuntu-kernel-team
Revision history for this message
Sergio Zanchetta (primes2h) wrote :

The 18 month support period for Edgy Eft 6.10 has reached it's end of life. As a result, we are closing the linux-source-2.6.17 Edgy Eft kernel task.

Hardy Heron 8.04 was recently released. It would be helpful if you could test the new release and verify if this is still an issue - http://www.ubuntu.com/getubuntu/download . You should be able to test your bug using the LiveCD. Please let us know your results. Thanks.

Changed in linux-source-2.6.17:
status: Triaged → Invalid
description: updated
Changed in linux:
status: New → Incomplete
Changed in linux-source-2.6.17:
status: Invalid → Won't Fix
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

Revision history for this message
Ralph Janke (txwikinger) wrote :

As per the comment https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/48418/comments/9 this is fixed. Opened another bug report for the man page correction. See Bug #280814

Changed in linux:
importance: Undecided → Medium
status: Incomplete → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote : Kernel team bugs

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.