Bug 4675 - umount.cifs creates /etc/mtab as a file even when it is a symlink
umount.cifs creates /etc/mtab as a file even when it is a symlink
Product: CifsVFS
Classification: Unclassified
Component: user space tools
Other Linux
: P3 normal
: ---
Assigned To: Karolin Seeger
Depends on:
  Show dependency treegraph
Reported: 2007-05-31 16:31 UTC by Christian Perrier
Modified: 2009-09-10 01:35 UTC (History)
2 users (show)

See Also:

patch to fix updating of /etc/mtab (888 bytes, patch)
2009-07-26 15:07 UTC, Shirish S. Pargaonkar
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Perrier 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
// /mnt/150/builds cifs rw,mand,unc=\\\builds,username=root,rsize=16384,wsize=57344 0 0
// /mnt/150/repositories cifs rw,mand,unc=\\\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 Shirish S. Pargaonkar 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 Shirish S. Pargaonkar 2009-07-27 12:48:21 UTC
patch committed to samba master branch. Closing as FIXED. 
Please reopen otherwise.
Comment 5 Christian Perrier 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?


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