summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-05-21 17:12:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:44 -0500
commitbaa81e29593bbf73711914aadc35306fbf79ba21 (patch)
treeb34b8d55b483174ccba65b875efa42bbb4be1df7
parent774d66c1e69ab17dc3c3c188dafc6b2b005fd562 (diff)
downloadsamba-baa81e29593bbf73711914aadc35306fbf79ba21.tar.gz
samba-baa81e29593bbf73711914aadc35306fbf79ba21.tar.bz2
samba-baa81e29593bbf73711914aadc35306fbf79ba21.zip
r23043: allow more than UINT16_MAX - 1 handles on smb2 connections
metze (This used to be commit 6d08c4cef22f6620cc11b712d0814772f747f466)
-rw-r--r--source4/smb_server/tcon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/smb_server/tcon.c b/source4/smb_server/tcon.c
index f3415ad936..57583afb04 100644
--- a/source4/smb_server/tcon.c
+++ b/source4/smb_server/tcon.c
@@ -147,6 +147,7 @@ static struct smbsrv_tcon *smbsrv_tcon_new(struct smbsrv_connection *smb_conn,
{
TALLOC_CTX *mem_ctx;
struct smbsrv_tcons_context *tcons_ctx;
+ uint32_t handle_uint_max;
struct smbsrv_tcon *tcon;
NTSTATUS status;
int i;
@@ -154,9 +155,11 @@ static struct smbsrv_tcon *smbsrv_tcon_new(struct smbsrv_connection *smb_conn,
if (smb_sess) {
mem_ctx = smb_sess;
tcons_ctx = &smb_sess->smb2_tcons;
+ handle_uint_max = UINT32_MAX;
} else {
mem_ctx = smb_conn;
tcons_ctx = &smb_conn->smb_tcons;
+ handle_uint_max = UINT16_MAX;
}
tcon = talloc_zero(mem_ctx, struct smbsrv_tcon);
@@ -170,7 +173,7 @@ static struct smbsrv_tcon *smbsrv_tcon_new(struct smbsrv_connection *smb_conn,
* the use -1 here, because we don't want to give away the wildcard
* fnum used in SMBflush
*/
- status = smbsrv_init_handles(tcon, UINT16_MAX - 1);
+ status = smbsrv_init_handles(tcon, handle_uint_max - 1);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1,("ERROR! failed to init handles: %s\n", nt_errstr(status)));
goto failed;