From 8a68f96f8cea2c53c8babf2ec826dfc6ef1cc199 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 22 Jun 2005 02:12:26 +0000 Subject: r7827: Add in-memory keytab to Samba4, using the new MEMORY_WILDCARD keytab support in Heimdal. This removes the 'ext_keytab' step from my Samba4/WinXP client howto. In doing this work, I realised that the replay cache in Heimdal is currently a no-op, so I have removed the calls to it, and therefore the mutex calls from passdb/secrets.c. This patch also includes a replacement 'magic' mechanism detection, that does not issue extra error messages from deep inside the GSSAPI code. Andrew Bartlett (This used to be commit c19d5706f4fa760415b727b970bc99e7f1abd064) --- source4/lib/basic.mk | 1 - source4/lib/server_mutex.c | 58 ---------------------------------------------- 2 files changed, 59 deletions(-) delete mode 100644 source4/lib/server_mutex.c (limited to 'source4/lib') diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk index 6a463b8ec6..58cbca0198 100644 --- a/source4/lib/basic.mk +++ b/source4/lib/basic.mk @@ -73,7 +73,6 @@ ADD_OBJ_FILES = \ lib/ms_fnmatch.o \ lib/select.o \ lib/mutex.o \ - lib/server_mutex.o \ lib/idtree.o \ lib/unix_privs.o \ lib/db_wrap.o \ diff --git a/source4/lib/server_mutex.c b/source4/lib/server_mutex.c deleted file mode 100644 index 878e5497d8..0000000000 --- a/source4/lib/server_mutex.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Authenticate against a remote domain - Copyright (C) Andrew Tridgell 1992-2002 - Copyright (C) Andrew Bartlett 2002 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "includes.h" - -/* For reasons known only to MS, many of their NT/Win2k versions - need serialised access only. Two connections at the same time - may (in certain situations) cause connections to be reset, - or access to be denied. - - This locking allows smbd's mutlithread architecture to look - like the single-connection that NT makes. */ - -static char *mutex_server_name; -/* FIXME. ref_count should be allocated per name... JRA. */ -size_t ref_count; - -BOOL grab_server_mutex(const char *name) -{ - mutex_server_name = strdup(name); - if (!mutex_server_name) { - DEBUG(0,("grab_server_mutex: malloc failed for %s\n", name)); - return False; - } - if (!secrets_named_mutex(mutex_server_name, 10, &ref_count)) { - DEBUG(10,("grab_server_mutex: failed for %s\n", name)); - SAFE_FREE(mutex_server_name); - return False; - } - - return True; -} - -void release_server_mutex(void) -{ - if (mutex_server_name) { - secrets_named_mutex_release(mutex_server_name, &ref_count); - SAFE_FREE(mutex_server_name); - } -} -- cgit