idmap_hash: remove unused error checks
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Mar 2019 12:54:10 +0000 (13:54 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 15 Oct 2019 07:36:38 +0000 (09:36 +0200)
id_map_ptrs_init() is used in the callers in order to
set everything up as expected.

Other backends also just trust the caller.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/winbindd/idmap_hash/idmap_hash.c

index 73b38a25e4059082b89456cf2b3dc9657d902e63..8ab1699efecc455aa4fb2f19518e0d0959666086 100644 (file)
@@ -199,11 +199,6 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
        int i;
 
-       if (!ids) {
-               nt_status = NT_STATUS_INVALID_PARAMETER;
-               BAIL_ON_NTSTATUS_ERROR(nt_status);
-       }
-
        /* initialize the status to avoid suprise */
        for (i = 0; ids[i]; i++) {
                ids[i]->status = ID_UNKNOWN;
@@ -219,13 +214,6 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
 
                separate_hashes(ids[i]->xid.id, &h_domain, &h_rid);
 
-               /* Make sure the caller allocated memor for us */
-
-               if (!ids[i]->sid) {
-                       nt_status = NT_STATUS_INVALID_PARAMETER;
-                       BAIL_ON_NTSTATUS_ERROR(nt_status);
-               }
-
                /* If the domain hash doesn't find a SID in the table,
                   skip it */
 
@@ -249,11 +237,6 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
        int i;
 
-       if (!ids) {
-               nt_status = NT_STATUS_INVALID_PARAMETER;
-               BAIL_ON_NTSTATUS_ERROR(nt_status);
-       }
-
        /* initialize the status to avoid suprise */
        for (i = 0; ids[i]; i++) {
                ids[i]->status = ID_UNKNOWN;