summaryrefslogtreecommitdiff
path: root/net/samba/patches/patch-cd
blob: 732310c81923a4dc7e855553fa90d9f290c16859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$NetBSD: patch-cd,v 1.1 2006/07/11 07:34:35 ghen Exp $

Security patch from http://www.samba.org/samba/security/CAN-2006-3403.html
(fixes a memory exhaustion DoS against smbd).

--- source/smbd/service.c.orig	2006-01-25 00:46:32.000000000 +0100
+++ source/smbd/service.c
@@ -763,6 +763,11 @@ connection_struct *make_connection(const
 		smb_panic("make_connection: PANIC ERROR. Called as nonroot\n");
 	}
 
+	if (conn_num_open() > 2047) {
+		*status = NT_STATUS_INSUFF_SERVER_RESOURCES;
+		return NULL;
+	}
+
 	if(lp_security() != SEC_SHARE) {
 		vuser = get_valid_user_struct(vuid);
 		if (!vuser) {