More fix to initialize idmap statuses
authorBo Yang <boyang@novell.com>
Mon, 2 Mar 2009 06:19:50 +0000 (14:19 +0800)
committerJeremy Allison <jra@samba.org>
Mon, 2 Mar 2009 23:51:55 +0000 (15:51 -0800)
source3/winbindd/idmap_ad.c
source3/winbindd/idmap_adex/idmap_adex.c
source3/winbindd/idmap_hash/idmap_hash.c
source3/winbindd/idmap_nss.c
source3/winbindd/idmap_rid.c
source3/winbindd/idmap_tdb.c
source3/winbindd/idmap_tdb2.c

index b22e5af94aece5bcc7975232c6816e81c26003a2..5c29ba0b223dfd9aa604aaa11a9038634b0e7549 100644 (file)
@@ -304,6 +304,11 @@ static NTSTATUS idmap_ad_unixids_to_sids(struct idmap_domain *dom, struct id_map
        char *u_filter = NULL;
        char *g_filter = NULL;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        /* Only do query if we are online */
        if (idmap_is_offline()) {
                return NT_STATUS_FILE_IS_OFFLINE;
@@ -516,6 +521,11 @@ static NTSTATUS idmap_ad_sids_to_unixids(struct idmap_domain *dom, struct id_map
        int i;
        char *sidstr;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+
        /* Only do query if we are online */
        if (idmap_is_offline()) {
                return NT_STATUS_FILE_IS_OFFLINE;
index 7e186ca8a124b68e19ae496363339ed2411398e6..e2fcda83d329571a9708e2ca162a1bc2adf6d350 100644 (file)
@@ -159,6 +159,11 @@ static NTSTATUS _idmap_adex_get_sid_from_id(struct
        NTSTATUS nt_status;
         struct likewise_cell *cell;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        nt_status = _idmap_adex_init(dom, NULL);
        if (!NT_STATUS_IS_OK(nt_status))
                return nt_status;
@@ -207,6 +212,11 @@ static NTSTATUS _idmap_adex_get_id_from_sid(struct
        NTSTATUS nt_status;
         struct likewise_cell *cell;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        nt_status = _idmap_adex_init(dom, NULL);
        if (!NT_STATUS_IS_OK(nt_status))
                return nt_status;
index 7dd94aede0d1a94b6b762b2179dbb7106806c943..42830720f3c5ba32892a5806975f6da560040f86 100644 (file)
@@ -160,6 +160,11 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        nt_status = be_init(dom, NULL);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
 
@@ -206,6 +211,11 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        nt_status = be_init(dom, NULL);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
 
index 156fdc7cc9fc91bbf04adf570e4c79b23ad9e098..f50e6172baa117c0abb507205862a29db6773697 100644 (file)
@@ -44,6 +44,11 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
        TALLOC_CTX *ctx;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ctx = talloc_new(dom);
        if ( ! ctx) {
                DEBUG(0, ("Out of memory!\n"));
@@ -130,6 +135,11 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
        TALLOC_CTX *ctx;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ctx = talloc_new(dom);
        if ( ! ctx) {
                DEBUG(0, ("Out of memory!\n"));
index 9d1898708cb9f5bf4fa3ad763a686a1c147a5231..359bbfd4119e3fe59088e890e262ee43bfc89bb9 100644 (file)
@@ -171,6 +171,11 @@ static NTSTATUS idmap_rid_unixids_to_sids(struct idmap_domain *dom, struct id_ma
        NTSTATUS ret;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ridctx = talloc_get_type(dom->private_data, struct idmap_rid_context);
 
        ctx = talloc_new(dom);
@@ -205,6 +210,11 @@ static NTSTATUS idmap_rid_sids_to_unixids(struct idmap_domain *dom, struct id_ma
        NTSTATUS ret;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ridctx = talloc_get_type(dom->private_data, struct idmap_rid_context);
 
        ctx = talloc_new(dom);
index 3a64979f339d7426834b355dd41beca5ab3a93ca..22c17578e6b8a99f839fec72c8c6855e942a4d83 100644 (file)
@@ -775,6 +775,11 @@ static NTSTATUS idmap_tdb_unixids_to_sids(struct idmap_domain *dom, struct id_ma
        NTSTATUS ret;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
 
        for (i = 0; ids[i]; i++) {
@@ -813,6 +818,11 @@ static NTSTATUS idmap_tdb_sids_to_unixids(struct idmap_domain *dom, struct id_ma
        NTSTATUS ret;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
 
        for (i = 0; ids[i]; i++) {
index fb90dd097ec53b5d447119e6454cb494a0ff8873..b2723270ebc532da512d261c5dbf5ce3797e8bec 100644 (file)
@@ -655,6 +655,11 @@ static NTSTATUS idmap_tdb2_unixids_to_sids(struct idmap_domain *dom, struct id_m
        NTSTATUS ret;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context);
 
        for (i = 0; ids[i]; i++) {
@@ -692,6 +697,11 @@ static NTSTATUS idmap_tdb2_sids_to_unixids(struct idmap_domain *dom, struct id_m
        NTSTATUS ret;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context);
 
        for (i = 0; ids[i]; i++) {