Fixes from nsswitch testsuite. Lots of stuff works much better now. (-:
authorTim Potter <tpot@samba.org>
Wed, 9 May 2001 05:06:35 +0000 (05:06 +0000)
committerTim Potter <tpot@samba.org>
Wed, 9 May 2001 05:06:35 +0000 (05:06 +0000)
source/nsswitch/winbindd_glue.c
source/nsswitch/winbindd_user.c
source/nsswitch/winbindd_util.c

index 6f55e564f41575573fbadd5c7c8cee89e8138c48..ac48ae10134d4dd6206c18cfbeeb575a92d0262d 100644 (file)
@@ -306,7 +306,7 @@ BOOL wb_get_samr_query_userinfo(CLI_POLICY_HND *pol, uint32 info_level,
  done:
        if (got_user_pol) cli_samr_close(pol->cli, pol->mem_ctx, &user_pol);
 
-       return (result != NT_STATUS_NOPROBLEMO);
+       return (result == NT_STATUS_NOPROBLEMO);
 }
 
 /****************************************************************************
index f23593db887a0ca8e50e06a76e1bcf8a471311b9..43227b9dc1e59e9942f11dfb395da40b1c7e4cbf 100644 (file)
@@ -157,6 +157,8 @@ enum winbindd_result winbindd_getpwnam_from_user(struct winbindd_cli_state
        
        /* The following costs 3 packets */
 
+       ZERO_STRUCT(user_info);
+
        if (!winbindd_lookup_userinfo(domain, user_rid, &user_info)) {
                DEBUG(1, ("pwnam_from_user(): error getting user info for "
                          "user '%s'\n", name_user));
index 3d8fbd3da82819b9cea79600dd01cc85b5ceefbb..6026422c30ddce0a64ca1037296a3feb4ea9a6cd 100644 (file)
@@ -310,7 +310,7 @@ static BOOL get_any_dc_name(char *domain, fstring srv_name)
 
        /* Lookup domain controller name */
                
-       if (!get_dc_list(False, lp_workgroup(), &ip_list, &count))
+       if (!get_dc_list(False, domain, &ip_list, &count))
                return False;
                
        /* Firstly choose a PDC/BDC who has the same network address as any
@@ -327,7 +327,7 @@ static BOOL get_any_dc_name(char *domain, fstring srv_name)
        dc_ip = ip_list[i];
        free(ip_list);
                
-       if (!lookup_pdc_name(global_myname, lp_workgroup(), &dc_ip, srv_name))
+       if (!lookup_pdc_name(global_myname, domain, &dc_ip, srv_name))
                return False;
 
        return True;
@@ -430,8 +430,9 @@ BOOL lookup_domain_sid(char *domain_name, struct winbindd_domain *domain)
            return False;
     }
 
-    if (strequal(domain->controller, server_state.controller)) {
-           /* Do a level 5 query info policy */
+    /* Do a level 5 query info policy if we are looking up our own SID */
+
+    if (strequal(domain_name, lp_workgroup())) {
            return wb_lsa_query_info_pol(&server_state.lsa_handle, 0x05, 
                                         level5_dom, &domain->sid);
     } 
@@ -443,7 +444,7 @@ BOOL lookup_domain_sid(char *domain_name, struct winbindd_domain *domain)
     
     /* Look for domain name */
     
-    if (!res && domains && sids) {
+    if (res && domains && sids) {
             int found = False;
             int i;