s3:fix a comment typo
[abartlet/samba.git/.git] / source3 / auth / auth_util.c
index d53da7867c71505aab5b89a1124b53e4086cf67b..8167a80a4fac9f65fd5815df2631224012409766 100644 (file)
@@ -221,7 +221,7 @@ NTSTATUS make_user_info_map(auth_usersupplied_info **user_info,
         * This also deals with the client passing in a "" domain */
 
        if (!is_trusted_domain(domain) &&
-           !strequal(domain, get_global_sam_name()) )
+           !strequal(domain, my_sam_name()))
        {
                if (lp_map_untrusted_to_domain())
                        domain = my_sam_name();
@@ -2167,7 +2167,7 @@ bool make_auth_methods(struct auth_context *auth_context, auth_methods **auth_me
  * Verify whether or not given domain is trusted.
  *
  * @param domain_name name of the domain to be verified
- * @return true if domain is one of the trusted once or
+ * @return true if domain is one of the trusted ones or
  *         false if otherwise
  **/
 
@@ -2181,6 +2181,14 @@ 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 (strequal(dom_name, get_global_sam_name())) {
+               return false;
+       }
+
        /* if we are a DC, then check for a direct trust relationships */
 
        if ( IS_DC ) {