s3:winbindd fix a return code check
authorChristian Ambach <ambi@samba.org>
Wed, 24 Aug 2011 14:21:37 +0000 (16:21 +0200)
committerChristian Ambach <ambi@samba.org>
Wed, 24 Aug 2011 16:09:11 +0000 (18:09 +0200)
talloc_traverse_dict will return with -1 in case of an error and
might return positive values that indicate the count of found
entries

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed Aug 24 18:09:11 CEST 2011 on sn-devel-104

source3/winbindd/winbindd_group.c

index 1e4ad5fa8ac04d4a208d722c0cbb94644f2c61c8..2f8ba6a02368f57a1eadef24c78566035d532dd0 100644 (file)
@@ -115,7 +115,7 @@ NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
        c.len = 0;
 
        res = talloc_dict_traverse(members, getgr_calc_memberlen, &c);
-       if (res != 0) {
+       if (res == -1) {
                DEBUG(5, ("talloc_dict_traverse failed\n"));
                return NT_STATUS_INTERNAL_ERROR;
        }
@@ -128,7 +128,7 @@ NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
        }
 
        res = talloc_dict_traverse(members, getgr_unparse_members, &m);
-       if (res != 0) {
+       if (res == -1) {
                DEBUG(5, ("talloc_dict_traverse failed\n"));
                TALLOC_FREE(m.buf);
                return NT_STATUS_INTERNAL_ERROR;