Bug 2193 - No cifsumount - users cannot unmount CIFS filesystems
Summary: No cifsumount - users cannot unmount CIFS filesystems
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: user space tools (show other bugs)
Version: 2.6
Hardware: All Linux
: P3 normal
Target Milestone: ---
Assignee: Steve French
QA Contact:
Depends on:
Reported: 2004-12-27 06:26 UTC by Peter Astrand
Modified: 2005-04-15 14:11 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Peter Astrand 2004-12-27 06:26:21 UTC
With smbfs, if you make smbmnt and smbumount setuid root, a normal user can
mount and unmount shares. With the cifs filesystem, it is possible to mount by
making mount.cifs setuid root, but since there is no "umount.cifs" or
"cifsumount" utility, normal users cannot unmount. 

I've found some source for a "cifsumount" utility at
http://lists.samba.org/archive/linux-cifs-client/2003-December.txt, but it's not
included in the Samba distribution, as far as I can tell.
Comment 1 Steve French 2005-03-07 21:16:57 UTC
cifs version 1.29 (will be in 2.6.12, currently in mm tree) as I mentioned is 
somewhat better in handling the flag but work the real fix to cifs_readpages is 
queued up after some other key changes (would evaluate proposed patches though) 
Comment 2 Steve French 2005-03-08 11:00:16 UTC
The previous comment got appended to the wrong defect.  
Comment 3 Steve French 2005-04-14 09:38:37 UTC
umount.cifs is now in the Samba 3 development tree ("gcc umount.cifs.c -o
umount.cifs" and put umount.cifs in /sbin for most distributions, and make it
setuid).  There is a coreq change to add the corresponding ioctl (the uid check
is done in kernel by the way, not in userspace, to avoid user vs. kernel size
issues - ie 16 vs. 32 bit vs. larger uid conflicts).  The coreq change should be
in the final 1.32 version of cifs.ko module (but certainly by version 1.33).
Comment 4 Peter Astrand 2005-04-14 10:37:48 UTC
Thanks for your efforts!
Comment 5 Steve French 2005-04-15 14:11:11 UTC
The key kernel piece was added for changeset 1.2251 
and minor cleanup was done in 1.2252.

Let me know if you see changes needed.

The user space tool (umount.cifs), currenty does not update mtab (although it 
does unmount the filesystem as can be seen from /proc/mounts) but will fixed 
by version 0.4 of the tool.  Apparently putting the tool in /sbin and 
specifying -i on umount should invoke it (based on what I see in the umount 
code) but umount.cifs can be called directly if made setuid