s3:is_trusted_domain: shortcut if domain name == global_sam_name
authorMichael Adam <obnox@samba.org>
Sat, 14 Nov 2009 00:21:42 +0000 (01:21 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 11 Feb 2010 11:02:46 +0000 (12:02 +0100)
A domain can't have a trust with itself.
This saves some roundtrips to the ldap server for ldapsam.

Michael
(cherry picked from commit dc3a90cf21813526854c12db126d08ebf32f8ae5)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/auth/auth_util.c

index 7754984a07bda6cc3ecbe7906c7c420574b568f3..89aa4a3c38fac1dbcc33fd1d2a343c93dfeb43a7 100644 (file)
@@ -2180,6 +2180,10 @@ bool is_trusted_domain(const char* dom_name)
                return false;
        }
 
+       if (strequal(dom_name, get_global_sam_name())) {
+               return false;
+       }
+
        /* if we are a DC, then check for a direct trust relationships */
 
        if ( IS_DC ) {