summaryrefslogtreecommitdiff
path: root/net/samba/patches/patch-cd
blob: 9ec582287b89a36a4f04c09f42b455753342db84 (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.2 2006/07/11 07:42:31 ghen Exp $

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

--- smbd/service.c.orig	2006-01-25 00:46:32.000000000 +0100
+++ 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) {