These flags determine some of the permissions required to do an operation
*/
#define AS_USER (1<<0)
-#define USE_MUTEX (1<<1)
/*
define a list of possible SMB messages and their corresponding
/* 0x6d */ { NULL, NULL, 0 },
/* 0x6e */ { NULL, NULL, 0 },
/* 0x6f */ { NULL, NULL, 0 },
-/* 0x70 */ { "SMBtcon",reply_tcon,USE_MUTEX},
+/* 0x70 */ { "SMBtcon",reply_tcon,0},
/* 0x71 */ { "SMBtdis",reply_tdis,0},
-/* 0x72 */ { "SMBnegprot",reply_negprot,USE_MUTEX},
-/* 0x73 */ { "SMBsesssetupX",reply_sesssetup,USE_MUTEX},
+/* 0x72 */ { "SMBnegprot",reply_negprot,0},
+/* 0x73 */ { "SMBsesssetupX",reply_sesssetup,0},
/* 0x74 */ { "SMBulogoffX", reply_ulogoffX, 0}, /* ulogoff doesn't give a valid TID */
-/* 0x75 */ { "SMBtconX",reply_tcon_and_X,USE_MUTEX},
+/* 0x75 */ { "SMBtconX",reply_tcon_and_X,0},
/* 0x76 */ { NULL, NULL, 0 },
/* 0x77 */ { NULL, NULL, 0 },
/* 0x78 */ { NULL, NULL, 0 },
return;
}
- /* THREAD TESTING: use mutex to serialize calls to critical
- functions with global state */
- if (flags & USE_MUTEX) {
- MUTEX_LOCK_BY_ID(MUTEX_SMBD);
- }
smb_messages[type].fn(req);
- if (flags & USE_MUTEX) {
- MUTEX_UNLOCK_BY_ID(MUTEX_SMBD);
- }
}
*/
#include "includes.h"
+#include <pthread.h>
+#ifdef HAVE_BACKTRACE
+#include <execinfo.h>
+#endif
+#include "system/wait.h"
#include "events.h"
#include "dlinklist.h"
#include "smb_server/smb_server.h"
#include "process_model.h"
-#include "include/system/wait.h"
-#include "pthread.h"
-#ifdef HAVE_BACKTRACE
-#include "execinfo.h"
-#endif
static void *thread_connection_fn(void *thread_parm)
{
/* accept an incoming connection. */
status = socket_accept(server_socket->socket, &sock);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("accept_connection_single: accept: %s\n",
- nt_errstr(status)));
return;
}
ev = event_context_init(server_socket);
if (!ev) {
- DEBUG(0,("thread_accept_connection: failed to create event_context!\n"));
socket_destroy(sock);
return;
}
conn = server_setup_connection(ev, server_socket, sock, t, pthread_self());
if (!conn) {
- DEBUG(0,("server_setup_connection(ev, server_socket, sock, t) failed\n"));
event_context_destroy(ev);
socket_destroy(sock);
return;
/* called when a SMB connection goes down */
static void thread_terminate_connection(struct server_connection *conn, const char *reason)
{
- DEBUG(0,("thread_terminate_connection: reason[%s]\n",reason));
+ DEBUG(10,("thread_terminate_connection: reason[%s]\n",reason));
if (conn) {
talloc_free(conn);