From: Stefan Metzmacher Date: Tue, 21 Sep 2021 11:13:52 +0000 (+0200) Subject: CVE-2020-25717: s3:lib: add lp_allow_trusted_domains() logic to is_allowed_domain() X-Git-Tag: ldb-2.5.0~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52190982de134fb55abce76def0609651e45012e;p=thirdparty%2Fsamba.git CVE-2020-25717: s3:lib: add lp_allow_trusted_domains() logic to is_allowed_domain() is_allowed_domain() is a central place we already use to trigger NT_STATUS_AUTHENTICATION_FIREWALL_FAILED, so we can add additional logic there. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14801 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14556 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/source3/lib/util_names.c b/source3/lib/util_names.c index f0e9f699f29..b62ddb302c6 100644 --- a/source3/lib/util_names.c +++ b/source3/lib/util_names.c @@ -69,5 +69,18 @@ bool is_allowed_domain(const char *domain_name) } } - return true; + if (lp_allow_trusted_domains()) { + return true; + } + + if (strequal(lp_workgroup(), domain_name)) { + return true; + } + + if (is_myname(domain_name)) { + return true; + } + + DBG_NOTICE("Not trusted domain '%s'\n", domain_name); + return false; }