summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/winbindd_user.c')
-rw-r--r--source3/nsswitch/winbindd_user.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c
index 07bd2a30bf..a73b5c394c 100644
--- a/source3/nsswitch/winbindd_user.c
+++ b/source3/nsswitch/winbindd_user.c
@@ -524,7 +524,6 @@ static BOOL get_sam_user_entries(struct getent_state *ent, TALLOC_CTX *mem_ctx)
uint32 num_entries;
WINBIND_USERINFO *info;
struct getpwent_user *name_list = NULL;
- BOOL result = False;
struct winbindd_domain *domain;
struct winbindd_methods *methods;
unsigned int i;
@@ -552,12 +551,18 @@ static BOOL get_sam_user_entries(struct getent_state *ent, TALLOC_CTX *mem_ctx)
status = methods->query_user_list(domain, mem_ctx, &num_entries,
&info);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(10,("get_sam_user_entries: query_user_list failed with %s\n",
+ nt_errstr(status) ));
+ return False;
+ }
+
if (num_entries) {
name_list = SMB_REALLOC_ARRAY(name_list, struct getpwent_user, ent->num_sam_entries + num_entries);
if (!name_list) {
DEBUG(0,("get_sam_user_entries realloc failed.\n"));
- goto done;
+ return False;
}
}
@@ -602,11 +607,7 @@ static BOOL get_sam_user_entries(struct getent_state *ent, TALLOC_CTX *mem_ctx)
ent->sam_entries = name_list;
ent->sam_entry_index = 0;
- result = ent->num_sam_entries > 0;
-
- done:
-
- return result;
+ return ent->num_sam_entries > 0;
}
/* Fetch next passwd entry from ntdom database */
@@ -757,6 +758,10 @@ void winbindd_list_users(struct winbindd_cli_state *state)
status = methods->query_user_list(domain, state->mem_ctx,
&num_entries, &info);
+ if (!NT_STATUS_IS_OK(status)) {
+ continue;
+ }
+
if (num_entries == 0)
continue;