mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
s3: Parameters. Add 'async dns timeout' parameter. Default to 10. Minimum value 1.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
156f1dfc39
commit
8a140391d6
21
docs-xml/smbdotconf/tuning/asyncdnstimeout.xml
Normal file
21
docs-xml/smbdotconf/tuning/asyncdnstimeout.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<samba:parameter name="async dns timeout"
|
||||
context="G"
|
||||
type="integer"
|
||||
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
|
||||
<description>
|
||||
<para>The number of seconds the asynchronous DNS
|
||||
resolver code in Samba will wait for responses.
|
||||
Some of the Samba client library code uses internal
|
||||
asynchronous DNS resolution for A and AAAA records
|
||||
when trying to find Active Directory Domain controllers.
|
||||
This value prevents this name resolution code from
|
||||
waiting for DNS server timeouts.
|
||||
</para>
|
||||
<para>The minimum value of this parameter is clamped
|
||||
at 1 second.
|
||||
zero.</para>
|
||||
</description>
|
||||
|
||||
<value type="default">10</value>
|
||||
<value type="example">20</value>
|
||||
</samba:parameter>
|
@ -3066,6 +3066,9 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
|
||||
lpcfg_do_global_parameter(
|
||||
lp_ctx, "ldap max search request size", "256000");
|
||||
|
||||
/* Async DNS query timeout in seconds. */
|
||||
lpcfg_do_global_parameter(lp_ctx, "async dns timeout", "10");
|
||||
|
||||
for (i = 0; parm_table[i].label; i++) {
|
||||
if (!(lp_ctx->flags[i] & FLAG_CMDLINE)) {
|
||||
lp_ctx->flags[i] |= FLAG_DEFAULT;
|
||||
|
@ -886,6 +886,7 @@ int lp_min_receive_file_size(void);
|
||||
void widelinks_warning(int snum);
|
||||
const char *lp_ncalrpc_dir(void);
|
||||
void _lp_set_server_role(int server_role);
|
||||
uint32_t lp_get_async_dns_timeout(void);
|
||||
|
||||
/* The following definitions come from param/loadparm_ctx.c */
|
||||
|
||||
|
@ -961,6 +961,9 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
|
||||
Globals.ldap_max_authenticated_request_size = 16777216;
|
||||
Globals.ldap_max_search_request_size = 256000;
|
||||
|
||||
/* Async DNS query timeout (in seconds). */
|
||||
Globals.async_dns_timeout = 10;
|
||||
|
||||
/* Now put back the settings that were set with lp_set_cmdline() */
|
||||
apply_lp_set_cmdline();
|
||||
}
|
||||
@ -4755,3 +4758,16 @@ enum samba_weak_crypto lp_weak_crypto()
|
||||
|
||||
return Globals.weak_crypto;
|
||||
}
|
||||
|
||||
uint32_t lp_get_async_dns_timeout(void)
|
||||
{
|
||||
uint32_t val = Globals.async_dns_timeout;
|
||||
/*
|
||||
* Clamp minimum async dns timeout to 1 second
|
||||
* as per the man page.
|
||||
*/
|
||||
if (val < 1) {
|
||||
val = 1;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user