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, 26 Nov 2009 10:40:56 +0000 (11:40 +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)

source3/auth/auth_util.c

index 512cae0dcbb23bb74b5880c32d25d8397d3fc5e7..118f41c35b09ce9a3b9bacbf7033af44024a3cbb 100644 (file)
@@ -2185,6 +2185,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 ) {