#660431 cifs-utils: Only root can unmount user-mounted share

Package:
cifs-utils
Source:
cifs-utils
Description:
Common Internet File System utilities
Submitter:
Vladimir Kudrya
Date:
2014-12-13 14:39:13 UTC
Severity:
normal
#660431#5
Date:
2012-02-19 08:09:22 UTC
From:
To:
Hello everyone!
I'm running Debian testing.
There is a cifs share that is mounted by users.
fstab line:
//fileserver.domain.local/share /mnt/share cifs user,noauto,noexec 0 0

mount by user is succsessful, but trying to unmount it by the same user with either
"umount /mnt/share" or "umount //main.virton.local/soft" results in error:

"umount: only root can unmount //main.virton.local/soft from /mnt/share"

I tried differend ownership and mode for mountpoint, with the same result.
Both mount.cifs and umount binaries have SUID bit.
There is also no difference if local and remote usernames are the same or not.

I have also checked if same problem happens on local filesystems:
nope, I can mount and unmount local filesystem from user if it has 'user' option
in fstab. So it seems to be cifs-related, not umount.

#660431#10
Date:
2012-03-11 03:16:52 UTC
From:
To:
Same problem here.
Cifs only.
Options I am using are:
noauto,user,credentials=/root/.smbcred,uid=1000,gid=1000,nobrl

#660431#15
Date:
2012-03-11 03:20:45 UTC
From:
To:
man fstab didn't mention anything but man mount shows that I should "users" instead of "user".
Using that works.

#660431#20
Date:
2012-03-11 08:20:58 UTC
From:
To:
Confirmed, with 'users' option I can unmount the share. But I can do it with any user, not just the one from which I mounted the share.

From man mount:
"... given a line
                     /dev/cdrom  /cd  iso9660  ro,user,noauto,unhide
any user can mount the iso9660 filesystem found on his CDROM..."
"Only  the user that mounted a filesystem can unmount it again.  If any user should be able to unmount, then use users instead of user in the fstab line."

So it seems that 'users' option works as it should, but 'user' option fails in unmounting, i.e. I can not unmount share with the same user I mounted it with.

#660431#25
Date:
2012-03-13 06:33:26 UTC
From:
To:
Mount is registered as done by root.
Comparison with Ubuntu 11.10 where cifs moun/unmount works:
mount output in Ubuntu 11.10:
   //server/share on /mnt/share type cifs (rw,noexec,nosuid,nodev,user=[local_username])

mount output in current Debian testing:
  //server/share on /mnt/share type cifs (rw,nosuid,nodev,noexec,relatime,sec=ntlmi,unc=\\server\share,username=[remote_username],uid=1000,forceuid,gid=100,forcegid,addr=[server_ip_address],file_mode=0644,dir_mode=0755,nounix,serverino,rsize=61440,wsize=16580,actimeo=1)

No mention of local username.

On both systems fstab options are: "user,noauto,iocharset=utf8,file_mode=0644,dir_mode=0755,noexec"

#660431#30
Date:
2012-06-06 17:25:20 UTC
From:
To:
Same problem here. It is because /etc/mtab is now a symlink to /proc/mounts.
After replacing it with a normal file as before, user umount for cifs works
again. Please try that.

I have had similar problems with other filesystems - USB drive with FAT
and automounted ntfs-3g (see #673453 and #673446), which are already fixed
in testing.

#660431#35
Date:
2012-06-14 17:17:52 UTC
From:
To:
/proc/mounts contains different line.
#660431#40
Date:
2012-10-02 09:43:03 UTC
From:
To: