Bug 4675 - umount.cifs creates /etc/mtab as a file even when it is a symlink
Summary: umount.cifs creates /etc/mtab as a file even when it is a symlink
Status: RESOLVED FIXED
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: user space tools (show other bugs)
Version: 2.6
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact:
URL: http://bugs.debian.org/408394
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-31 16:31 UTC by Christian Perrier (dead mail address)
Modified: 2009-09-10 01:35 UTC (History)
2 users (show)

See Also:


Attachments
patch to fix updating of /etc/mtab (888 bytes, patch)
2009-07-26 15:07 UTC, shirishpargaonkar@gmail.com
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Perrier (dead mail address) 2007-05-31 16:31:17 UTC
From a Debian user:

umount.cifs removes /etc/mtab even if it's a symlink to /proc/mounts
and writes a regular file instead

I'm setting the Severity to "grave" because I think losing a symlink
can be considered "data loss" (the symlink is "data") and using a
regular file for mtab is not an option in my case.

Here's a session (only the relevant output, for brevity):

arwen:~# ls -l /etc/mtab
lrwxrwxrwx 1 root root 12 2007-01-25 17:38 /etc/mtab -> /proc/mounts
arwen:~# cat /proc/mounts
//10.0.0.150/builds /mnt/150/builds cifs rw,mand,unc=\\10.0.0.150\builds,username=root,rsize=16384,wsize=57344 0 0
//10.0.0.150/repositories /mnt/150/repositories cifs rw,mand,unc=\\10.0.0.150\repositories,username=root,rsize=16384,wsize=57344 0 0
arwen:~# umount /mnt/150/builds
arwen:~# ls -l /etc/mtab
-rw-r--r-- 1 root root 1281 2007-01-25 17:39 /etc/mtab

Comment by Christian:
I have been able to reproduce that bug easily, indeed
Comment 1 Debian samba package maintainers (PUBLIC MAILING LIST) 2009-01-03 13:10:52 UTC
This bug is still here in 3.3.0-rc2
Comment 2 Debian samba package maintainers (PUBLIC MAILING LIST) 2009-03-14 04:39:52 UTC
And still in 3.3.1
Comment 3 shirishpargaonkar@gmail.com 2009-07-26 15:07:13 UTC
Created attachment 4471 [details]
patch to fix updating of /etc/mtab

if /etc/mtab is a symlink, do not update it
Comment 4 shirishpargaonkar@gmail.com 2009-07-27 12:48:21 UTC
patch committed to samba master branch. Closing as FIXED. 
Please reopen otherwise.
Comment 5 Christian Perrier (dead mail address) 2009-09-09 15:44:44 UTC
The fix is committed to the master branch but was not pushed to release branches. If I understand the new  Samba Team policy, it needs review, then the bug should be assigned to Karolin for release
Comment 6 Volker Lendecke 2009-09-09 15:56:39 UTC
This went into master as a869e4253a87f9a5e13dbe87b2799f8683d238d7. This applies cleanly to v3-4-test for me and looks ok. From my point of view this can go in for 3.4.2.

Karolin, can you put this in?

Thanks,

Volker
Comment 7 Karolin Seeger 2009-09-10 01:35:58 UTC
Pushed, will be included in 3.4.2.
Closing out bug report.

Thanks!