[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-1287-gf710535
Karolin Seeger
kseeger at samba.org
Thu Sep 10 00:35:13 MDT 2009
The branch, v3-4-test has been updated
via f710535e947008a083b49d8a3faa117208616d7f (commit)
from 646f0534acf0c480a61e0a02d1d815347b5e6d52 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test
- Log -----------------------------------------------------------------
commit f710535e947008a083b49d8a3faa117208616d7f
Author: Shirish Pargaonkar <shirishpargaonkar at gmail.com>
Date: Mon Jul 27 12:02:35 2009 -0400
umount.cifs: do not attempt to update /etc/mtab if it is symbolic link
If /etc/mtab is a symbolic link to e.g. /proc/mounts, do not update it.
This is a fix for a bug reported in 4675 on samba bugzilla
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar at gmail.com>
(cherry picked from commit a869e4253a87f9a5e13dbe87b2799f8683d238d7)
Fixes bug #4675.
-----------------------------------------------------------------------
Summary of changes:
source3/client/umount.cifs.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/client/umount.cifs.c b/source3/client/umount.cifs.c
index 1227e7a..b57417f 100644
--- a/source3/client/umount.cifs.c
+++ b/source3/client/umount.cifs.c
@@ -146,9 +146,11 @@ static int remove_from_mtab(char * mountpoint)
FILE * org_fd;
FILE * new_fd;
struct mntent * mount_entry;
+ struct stat statbuf;
- /* Do we need to check if it is a symlink to e.g. /proc/mounts
- in which case we probably do not want to update it? */
+ /* If it is a symlink, e.g. to /proc/mounts, no need to update it. */
+ if ((lstat(MOUNTED, &statbuf) == 0) && (S_ISLNK(statbuf.st_mode)))
+ return 0;
/* Do we first need to check if it is writable? */
@@ -162,7 +164,6 @@ static int remove_from_mtab(char * mountpoint)
printf("attempting to remove from mtab\n");
org_fd = setmntent(MOUNTED, "r");
-
if(org_fd == NULL) {
printf("Can not open %s\n",MOUNTED);
unlock_mtab();
--
Samba Shared Repository
More information about the samba-cvs
mailing list