aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-02-07 20:29:19 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-03-07 13:36:46 +0000
commit3639ac66cb9f5ffe14deccbecab6e139d45ddbee (patch)
tree85d97245b925af37a09548baa95b9b19b2bbc405
parentb009a5523a84e11bb7f2b5b43d17dabb4033e6ba (diff)
downloadalpine_aports-3639ac66cb9f5ffe14deccbecab6e139d45ddbee.tar.bz2
alpine_aports-3639ac66cb9f5ffe14deccbecab6e139d45ddbee.tar.xz
alpine_aports-3639ac66cb9f5ffe14deccbecab6e139d45ddbee.zip
main/samba: backport configurable max num of winbindd clients
fixes #522
-rw-r--r--main/samba/APKBUILD6
-rw-r--r--main/samba/samba-maximum-number-of-winbindd-clients.patch134
2 files changed, 138 insertions, 2 deletions
diff --git a/main/samba/APKBUILD b/main/samba/APKBUILD
index d9ba981d3d..c470cb87fa 100644
--- a/main/samba/APKBUILD
+++ b/main/samba/APKBUILD
@@ -1,7 +1,7 @@
1# Maintainer: Natanael Copa <ncopa@alpinelinux.org> 1# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2pkgname=samba 2pkgname=samba
3pkgver=3.5.6 3pkgver=3.5.6
4pkgrel=0 4pkgrel=4
5pkgdesc="Tools to access a server's filespace and printers via SMB" 5pkgdesc="Tools to access a server's filespace and printers via SMB"
6url="http://www.samba.org" 6url="http://www.samba.org"
7license="GPL3" 7license="GPL3"
@@ -15,6 +15,7 @@ source="http://us1.$pkgname.org/$pkgname/ftp/stable/$pkgname-$pkgver.tar.gz
15 samba.confd 15 samba.confd
16 samba.logrotate 16 samba.logrotate
17 samba-uclibc-fstab.patch 17 samba-uclibc-fstab.patch
18 samba-maximum-number-of-winbindd-clients.patch
18 " 19 "
19pkggroups="winbind" 20pkggroups="winbind"
20 21
@@ -122,4 +123,5 @@ md5sums="bf6c09ea497a166df8bd672db1d8da8f samba-3.5.6.tar.gz
122c8a7f6ac5df2f73dbf023e25ea39927b samba.initd 123c8a7f6ac5df2f73dbf023e25ea39927b samba.initd
123c150433426e18261e6e3eed3930e1a76 samba.confd 124c150433426e18261e6e3eed3930e1a76 samba.confd
124b7cafabfb4fa5b3ab5f2e857d8d1c733 samba.logrotate 125b7cafabfb4fa5b3ab5f2e857d8d1c733 samba.logrotate
125811e5a3f570d0053cf27a73248be4ae6 samba-uclibc-fstab.patch" 126811e5a3f570d0053cf27a73248be4ae6 samba-uclibc-fstab.patch
127a906d4049df6ca1a3c106e7df52d9925 samba-maximum-number-of-winbindd-clients.patch"
diff --git a/main/samba/samba-maximum-number-of-winbindd-clients.patch b/main/samba/samba-maximum-number-of-winbindd-clients.patch
new file mode 100644
index 0000000000..6e84bb413b
--- /dev/null
+++ b/main/samba/samba-maximum-number-of-winbindd-clients.patch
@@ -0,0 +1,134 @@
1From eeb24afd78a6448e808aaf96dbd7d5abf51bbd40 Mon Sep 17 00:00:00 2001
2From: Pierre Carrier <pcarrier@redhat.com>
3Date: Tue, 14 Sep 2010 16:43:39 -0700
4Subject: [PATCH] Allows changing the maximum number of simultaneous clients in winbindd through an smb.conf option.
5
6Signed-off-by: Jeremy Allison <jra@samba.org>
7---
8 docs-xml/smbdotconf/winbind/winbindmaxclients.xml | 14 ++++++++++++++
9 source3/include/local.h | 3 ---
10 source3/include/proto.h | 1 +
11 source3/param/loadparm.c | 13 ++++++++++++-
12 source3/winbindd/winbindd.c | 8 +++-----
13 5 files changed, 30 insertions(+), 9 deletions(-)
14 create mode 100644 docs-xml/smbdotconf/winbind/winbindmaxclients.xml
15
16diff --git a/docs-xml/smbdotconf/winbind/winbindmaxclients.xml b/docs-xml/smbdotconf/winbind/winbindmaxclients.xml
17new file mode 100644
18index 0000000..ae49e45
19--- /dev/null
20+++ b/docs-xml/smbdotconf/winbind/winbindmaxclients.xml
21@@ -0,0 +1,14 @@
22+<samba:parameter name="winbind max clients"
23+ context="G"
24+ type="integer"
25+ advanced="1" developer="1"
26+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
27+<description>
28+ <para>This parameter specifies the maximum number of clients
29+ the <citerefentry><refentrytitle>winbindd</refentrytitle>
30+ <manvolnum>8</manvolnum></citerefentry> daemon can connect with.
31+ </para>
32+</description>
33+
34+<value type="default">200</value>
35+</samba:parameter>
36diff --git a/source3/include/local.h b/source3/include/local.h
37index a3baf64..93ec4cc 100644
38--- a/source3/include/local.h
39+++ b/source3/include/local.h
40@@ -239,9 +239,6 @@
41 /* Number in seconds for winbindd to wait for the mutex. Make this 2 * smbd wait time. */
42 #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
43
44-/* Max number of simultaneous winbindd socket connections. */
45-#define WINBINDD_MAX_SIMULTANEOUS_CLIENTS 200
46-
47 /* Buffer size to use when printing backtraces */
48 #define BACKTRACE_STACK_SIZE 64
49
50diff --git a/source3/include/proto.h b/source3/include/proto.h
51index f089c69..e1751e8 100644
52--- a/source3/include/proto.h
53+++ b/source3/include/proto.h
54@@ -3539,6 +3539,7 @@ int lp_smb_encrypt(int );
55 char lp_magicchar(const struct share_params *p );
56 int lp_winbind_cache_time(void);
57 int lp_winbind_reconnect_delay(void);
58+int lp_winbind_max_clients(void);
59 const char **lp_winbind_nss_info(void);
60 int lp_algorithmic_rid_base(void);
61 int lp_name_cache_timeout(void);
62diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
63index e3fc2d8..bb6e132 100644
64--- a/source3/param/loadparm.c
65+++ b/source3/param/loadparm.c
66@@ -262,7 +262,7 @@ struct global {
67 int oplock_break_wait_time;
68 int winbind_cache_time;
69 int winbind_reconnect_delay;
70- int winbind_max_idle_children;
71+ int winbind_max_clients;
72 char **szWinbindNssInfo;
73 int iLockSpinTime;
74 char *szLdapMachineSuffix;
75@@ -4606,6 +4606,15 @@ static struct parm_struct parm_table[] = {
76 .flags = FLAG_ADVANCED,
77 },
78 {
79+ .label = "winbind max clients",
80+ .type = P_INTEGER,
81+ .p_class = P_GLOBAL,
82+ .ptr = &Globals.winbind_max_clients,
83+ .special = NULL,
84+ .enum_list = NULL,
85+ .flags = FLAG_ADVANCED,
86+ },
87+ {
88 .label = "winbind enum users",
89 .type = P_BOOL,
90 .p_class = P_GLOBAL,
91@@ -5299,6 +5308,7 @@ static void init_globals(bool reinit_globals)
92
93 Globals.winbind_cache_time = 300; /* 5 minutes */
94 Globals.winbind_reconnect_delay = 30; /* 30 seconds */
95+ Globals.winbind_max_clients = 200;
96 Globals.bWinbindEnumUsers = False;
97 Globals.bWinbindEnumGroups = False;
98 Globals.bWinbindUseDefaultDomain = False;
99@@ -5877,6 +5887,7 @@ FN_LOCAL_INTEGER(lp_smb_encrypt, ismb_encrypt)
100 FN_LOCAL_CHAR(lp_magicchar, magic_char)
101 FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time)
102 FN_GLOBAL_INTEGER(lp_winbind_reconnect_delay, &Globals.winbind_reconnect_delay)
103+FN_GLOBAL_INTEGER(lp_winbind_max_clients, &Globals.winbind_max_clients)
104 FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo)
105 FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase)
106 FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout)
107diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
108index 7a9ebb8..9c0a1fb 100644
109--- a/source3/winbindd/winbindd.c
110+++ b/source3/winbindd/winbindd.c
111@@ -908,17 +908,15 @@ static void winbindd_listen_fde_handler(struct tevent_context *ev,
112 struct winbindd_listen_state *s = talloc_get_type_abort(private_data,
113 struct winbindd_listen_state);
114
115- while (winbindd_num_clients() >
116- WINBINDD_MAX_SIMULTANEOUS_CLIENTS - 1) {
117+ while (winbindd_num_clients() > lp_winbind_max_clients() - 1) {
118 DEBUG(5,("winbindd: Exceeding %d client "
119 "connections, removing idle "
120- "connection.\n",
121- WINBINDD_MAX_SIMULTANEOUS_CLIENTS));
122+ "connection.\n", lp_winbind_max_clients()));
123 if (!remove_idle_client()) {
124 DEBUG(0,("winbindd: Exceeding %d "
125 "client connections, no idle "
126 "connection found\n",
127- WINBINDD_MAX_SIMULTANEOUS_CLIENTS));
128+ lp_winbind_max_clients()));
129 break;
130 }
131 }
132--
1331.7.0.4
134