s3:is_trusted_domain: shortcut if domain name is NULL or empty
authorMichael Adam <obnox@samba.org>
Sat, 14 Nov 2009 00:12:22 +0000 (01:12 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 Nov 2009 10:40:56 +0000 (11:40 +0100)
This saves some roundtrips to LDAP in an ldapsm setup.

Michael
(cherry picked from commit 0aa5a60d3033fddd652eb4ea89abdf97db912df3)

source3/auth/auth_util.c

index 1d25e2220284e3a4ba64df18ccc3490560c3eef5..512cae0dcbb23bb74b5880c32d25d8397d3fc5e7 100644 (file)
@@ -2181,6 +2181,10 @@ bool is_trusted_domain(const char* dom_name)
        if ( lp_server_role() == ROLE_STANDALONE )
                return False;
 
+       if (dom_name == NULL || dom_name[0] == '\0') {
+               return false;
+       }
+
        /* if we are a DC, then check for a direct trust relationships */
 
        if ( IS_DC ) {