Use GUID_equal in a few places
authorVolker Lendecke <vl@samba.org>
Thu, 5 Jun 2014 10:04:43 +0000 (10:04 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 10 Jun 2014 17:19:13 +0000 (19:19 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_ioctl_network_fs.c
source4/dsdb/kcc/kcc_drs_replica_info.c
source4/dsdb/kcc/kcc_periodic.c
source4/dsdb/repl/drepl_notify.c
source4/dsdb/repl/drepl_out_pull.c
source4/dsdb/repl/drepl_partitions.c
source4/dsdb/samdb/ldb_modules/util.c
source4/rpc_server/drsuapi/updaterefs.c

index 11843a49a4ee8d9a7368d8d69fe54b656101f7d4..5e0dc10ab73c5a942bb5c7d7f1c576c42f7e1c31 100644 (file)
@@ -395,7 +395,7 @@ static NTSTATUS fsctl_validate_neg_info(TALLOC_CTX *mem_ctx,
                }
        }
 
-       if (GUID_compare(&in_guid, &conn->smb2.client.guid) != 0) {
+       if (!GUID_equal(&in_guid, &conn->smb2.client.guid)) {
                *disconnect = true;
                return NT_STATUS_ACCESS_DENIED;
        }
index ac22312a0cecacc43d7ec11743da7f035bd1cecb..52c36cabb0a68372f59e4fbfd3bfcd3b507bc567 100644 (file)
@@ -629,8 +629,8 @@ static WERROR kccdrs_replica_get_info_neighbours(TALLOC_CTX *mem_ctx,
                        }
 
                        if (GUID_all_zero(&req_src_dsa_guid) ||
-                           GUID_compare(&req_src_dsa_guid, &reps_from->source_dsa_obj_guid) == 0)
-                       {
+                           GUID_equal(&req_src_dsa_guid,
+                                      &reps_from->source_dsa_obj_guid)) {
 
                                if (i >= base_index) {
                                        struct drsuapi_DsReplicaNeighbour neigh;
index 4db4d4ee704fcd57478e8a3c0c4014477a29ca92..34bae96c90e9e35b3cc1076aafc92f8abe13873d 100644 (file)
@@ -42,8 +42,8 @@
  */
 static bool kccsrv_same_source_dsa(struct repsFromToBlob *r1, struct repsFromToBlob *r2)
 {
-       return GUID_compare(&r1->ctr.ctr1.source_dsa_obj_guid,
-                           &r2->ctr.ctr1.source_dsa_obj_guid) == 0;
+       return GUID_equal(&r1->ctr.ctr1.source_dsa_obj_guid,
+                         &r2->ctr.ctr1.source_dsa_obj_guid);
 }
 
 /*
@@ -498,7 +498,7 @@ NTSTATUS kccsrv_simple_update(struct kccsrv_service *s, TALLOC_CTX *mem_ctx)
                struct GUID ntds_guid, invocation_id;
 
                ntds_guid = samdb_result_guid(res->msgs[i], "objectGUID");
-               if (GUID_compare(&ntds_guid, &s->ntds_guid) == 0) {
+               if (GUID_equal(&ntds_guid, &s->ntds_guid)) {
                        /* don't replicate with ourselves */
                        continue;
                }
index 905fe5f604fe44f84d351d5d8870665889f4ef67..3f2c8519dc77a909732aa7bcbb42270685cfb180 100644 (file)
@@ -255,14 +255,14 @@ static struct dreplsrv_partition_source_dsa *dreplsrv_find_notify_dsa(struct dre
 
        /* first check the sources list */
        for (s=p->sources; s; s=s->next) {
-               if (GUID_compare(&s->repsFrom1->source_dsa_obj_guid, guid) == 0) {
+               if (GUID_equal(&s->repsFrom1->source_dsa_obj_guid, guid)) {
                        return s;
                }
        }
 
        /* then the notifies list */
        for (s=p->notifies; s; s=s->next) {
-               if (GUID_compare(&s->repsFrom1->source_dsa_obj_guid, guid) == 0) {
+               if (GUID_equal(&s->repsFrom1->source_dsa_obj_guid, guid)) {
                        return s;
                }
        }
index 58d877870eb7996d1528660d9d6ff3e6426cafaf..e64c91d29a00bae6884cc6c09c4a70d52c7ec1c8 100644 (file)
@@ -57,8 +57,8 @@ void drepl_reps_update(struct dreplsrv_service *s, const char *reps_attr,
        }
 
        for (i=0; i<count; i++) {
-               if (GUID_compare(source_dsa_obj_guid,
-                                &reps[i].ctr.ctr1.source_dsa_obj_guid) == 0) {
+               if (GUID_equal(source_dsa_obj_guid,
+                              &reps[i].ctr.ctr1.source_dsa_obj_guid)) {
                        break;
                }
        }
index 7be069e0dc57200fb3cfa43c27e2f4d60beeeb9f..8c85ef6f2588d04394754aa5c353b89cde3585c9 100644 (file)
@@ -364,7 +364,7 @@ static struct dreplsrv_partition_source_dsa *dreplsrv_find_source_dsa(struct dre
 {
        struct dreplsrv_partition_source_dsa *s;
        for (s=list; s; s=s->next) {
-               if (GUID_compare(&s->repsFrom1->source_dsa_obj_guid, guid) == 0) {
+               if (GUID_equal(&s->repsFrom1->source_dsa_obj_guid, guid)) {
                        return s;
                }
        }
@@ -415,8 +415,8 @@ static WERROR dreplsrv_partition_add_source_dsa(struct dreplsrv_service *s,
 
        /* re-use an existing source if found */
        for (s2=*listp; s2; s2=s2->next) {
-               if (GUID_compare(&s2->repsFrom1->source_dsa_obj_guid, 
-                                &source->repsFrom1->source_dsa_obj_guid) == 0) {
+               if (GUID_equal(&s2->repsFrom1->source_dsa_obj_guid,
+                                &source->repsFrom1->source_dsa_obj_guid)) {
                        talloc_free(s2->repsFrom1->other_info);
                        *s2->repsFrom1 = *source->repsFrom1;
                        talloc_steal(s2, s2->repsFrom1->other_info);
index 147e3578471fa6f1b1d799e4f266e66895bc7a16..a71c49b042ca669aed942333df7b1f9729da9d60 100644 (file)
@@ -742,7 +742,7 @@ int dsdb_check_optional_feature(struct ldb_module *module, struct GUID op_featur
 
                        search_guid = samdb_result_guid(res->msgs[0], "msDS-OptionalFeatureGUID");
 
-                       if (GUID_compare(&search_guid, &op_feature_guid) == 0) {
+                       if (GUID_equal(&search_guid, &op_feature_guid)) {
                                *feature_enabled = true;
                                break;
                        }
index ae87117d656f7842670b11956c63cb373b7c024f..6fdbf2e04bfbd3a3b2ec237b713e533fd0343bf1 100644 (file)
@@ -50,8 +50,8 @@ static WERROR uref_add_dest(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
        }
 
        for (i=0; i<reps.count; i++) {
-               if (GUID_compare(&dest->source_dsa_obj_guid, 
-                                &reps.r[i].ctr.ctr1.source_dsa_obj_guid) == 0) {
+               if (GUID_equal(&dest->source_dsa_obj_guid,
+                              &reps.r[i].ctr.ctr1.source_dsa_obj_guid)) {
                        if (options & DRSUAPI_DRS_GETCHG_CHECK) {
                                return WERR_OK;
                        } else {
@@ -97,7 +97,8 @@ static WERROR uref_del_dest(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
        }
 
        for (i=0; i<reps.count; i++) {
-               if (GUID_compare(dest_guid, &reps.r[i].ctr.ctr1.source_dsa_obj_guid) == 0) {
+               if (GUID_equal(dest_guid,
+                              &reps.r[i].ctr.ctr1.source_dsa_obj_guid)) {
                        if (i+1 < reps.count) {
                                memmove(&reps.r[i], &reps.r[i+1], sizeof(reps.r[i])*(reps.count-(i+1)));
                        }