$OpenBSD: patch-smbd_service_c,v 1.1 2006/08/09 12:54:04 bernd Exp $

Fix for CVE-2006-3403. Patch from Debian.

--- smbd/service.c.orig	Wed Aug  9 13:07:00 2006
+++ smbd/service.c	Wed Aug  9 13:08:04 2006
@@ -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) {
