Revert "hash_domain_sid UINT32_MAX"
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Mar 2019 15:36:09 +0000 (16:36 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 15 Oct 2019 07:36:38 +0000 (09:36 +0200)
This reverts commit 054bc9fcc94f30344ec2c662eb031dde275ffbb5.

source3/winbindd/idmap_hash/idmap_hash.c

index ef630be1c9adf9d1f01a6ab913a94f7e846a114a..120d22097f4e017d58af9acc29eb13be1c1eb5c2 100644 (file)
@@ -42,9 +42,8 @@ static uint32_t hash_domain_sid(const struct dom_sid *sid)
 {
        uint32_t hash;
 
-       if (sid->num_auths != 4) {
-               return UINT32_MAX;
-       }
+       if (sid->num_auths != 4)
+               return 0;
 
        /* XOR the last three subauths */
 
@@ -164,10 +163,8 @@ static NTSTATUS idmap_hash_initialize(struct idmap_domain *dom)
                        continue;
                }
 
-               hash = hash_domain_sid(&dom_list[i].sid);
-               if (hash == UINT32_MAX) {
+               if ((hash = hash_domain_sid(&dom_list[i].sid)) == 0)
                        continue;
-               }
 
                DBG_INFO("Adding %s (%s) -> %d\n",
                         dom_list[i].domain_name,
@@ -274,8 +271,8 @@ static NTSTATUS idmap_hash_sid_to_id(struct sid_hash_table *hashed_domains,
        h_domain = hash_domain_sid(&sid);
        h_rid = hash_rid(rid);
 
-       /* Check that both hashes are valid */
-       if (h_domain == UINT32_MAX) {
+       /* Check that both hashes are non-zero*/
+       if (h_domain == 0) {
                return NT_STATUS_NONE_MAPPED;
        }
        if (h_rid == 0) {