summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-01-13 18:45:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:06 -0500
commitaa363846d6c26869a780b1ad1ad2e3b3588a7387 (patch)
treeac66731a2c2a927f6fc9a2a8c5df81a08d54d8f0
parent8eba11978decb40f0644909e8e9cb1dbed3391c7 (diff)
downloadsamba-aa363846d6c26869a780b1ad1ad2e3b3588a7387.tar.gz
samba-aa363846d6c26869a780b1ad1ad2e3b3588a7387.tar.bz2
samba-aa363846d6c26869a780b1ad1ad2e3b3588a7387.zip
r12912: patch from Tony Mountifield <tony@softins.co.uk> for BUG 3327 (fix bad access to gencache.tdb after fork() in smbmount
(This used to be commit 68399ce04ca4509d51950d2d7b1ed817e82bf17c)
-rw-r--r--source3/client/smbmount.c3
-rw-r--r--source3/lib/gencache.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
index 4438964b83..d8254ef23a 100644
--- a/source3/client/smbmount.c
+++ b/source3/client/smbmount.c
@@ -386,6 +386,9 @@ static void send_fs_socket(char *the_service, char *mount_point, struct cli_stat
c = NULL;
if (!closed) {
+ /* close the name cache so that close_our_files() doesn't steal its FD */
+ namecache_shutdown();
+
/* redirect stdout & stderr since we can't know that
the library functions we use are using DEBUG. */
if ( (fd = open("/dev/null", O_WRONLY)) < 0)
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 85599c92d3..fd44616270 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -83,10 +83,13 @@ BOOL gencache_init(void)
BOOL gencache_shutdown(void)
{
+ int ret;
/* tdb_close routine returns -1 on error */
if (!cache) return False;
DEBUG(5, ("Closing cache file\n"));
- return tdb_close(cache) != -1;
+ ret = tdb_close(cache);
+ cache = NULL;
+ return ret != -1;
}