The branch, master has been updated via f4e358b libcli: Add a NULL check in dom_sid_string via 7c2b5e7 Use GUID_equal in a few places via e22a067 libndr: Use GUID_compare in GUID_equal from 9c6f1a5 s3: libsmb: Change cli_disk_size() to use the trans2/SMB_FS_FULL_SIZE_INFORMATION call in preference to the old SMB1 call.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit f4e358bc8b5490ebc696525d5e190f2e9364e196 Author: Volker Lendecke <v...@samba.org> Date: Tue Jun 3 13:03:56 2014 +0000 libcli: Add a NULL check in dom_sid_string Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Tue Jun 10 21:46:15 CEST 2014 on sn-devel-104 commit 7c2b5e77b00bdf776619458920fe74981427ee6a Author: Volker Lendecke <v...@samba.org> Date: Thu Jun 5 10:04:43 2014 +0000 Use GUID_equal in a few places Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit e22a0675c222077bee25c4ef1da5d00996d2c199 Author: Volker Lendecke <v...@samba.org> Date: Thu Jun 5 09:56:55 2014 +0000 libndr: Use GUID_compare in GUID_equal Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: libcli/security/dom_sid.c | 3 +++ librpc/ndr/uuid.c | 10 +--------- source3/smbd/smb2_ioctl_network_fs.c | 2 +- source4/dsdb/kcc/kcc_drs_replica_info.c | 4 ++-- source4/dsdb/kcc/kcc_periodic.c | 6 +++--- source4/dsdb/repl/drepl_notify.c | 4 ++-- source4/dsdb/repl/drepl_out_pull.c | 4 ++-- source4/dsdb/repl/drepl_partitions.c | 6 +++--- source4/dsdb/samdb/ldb_modules/util.c | 2 +- source4/rpc_server/drsuapi/updaterefs.c | 7 ++++--- 10 files changed, 22 insertions(+), 26 deletions(-) Changeset truncated at 500 lines: diff --git a/libcli/security/dom_sid.c b/libcli/security/dom_sid.c index 90f5401..836979e 100644 --- a/libcli/security/dom_sid.c +++ b/libcli/security/dom_sid.c @@ -414,6 +414,9 @@ char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) * the length */ result = (char *)talloc_memdup(mem_ctx, buf, len+1); + if (result == NULL) { + return NULL; + } /* * beautify the talloc_report output diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c index cefe7b6..5558cb6 100644 --- a/librpc/ndr/uuid.c +++ b/librpc/ndr/uuid.c @@ -197,15 +197,7 @@ _PUBLIC_ bool GUID_all_zero(const struct GUID *u) _PUBLIC_ bool GUID_equal(const struct GUID *u1, const struct GUID *u2) { - if (u1->time_low != u2->time_low || - u1->time_mid != u2->time_mid || - u1->time_hi_and_version != u2->time_hi_and_version || - u1->clock_seq[0] != u2->clock_seq[0] || - u1->clock_seq[1] != u2->clock_seq[1] || - memcmp(u1->node, u2->node, 6) != 0) { - return false; - } - return true; + return (GUID_compare(u1, u2) == 0); } _PUBLIC_ int GUID_compare(const struct GUID *u1, const struct GUID *u2) diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c index 11843a4..5e0dc10 100644 --- a/source3/smbd/smb2_ioctl_network_fs.c +++ b/source3/smbd/smb2_ioctl_network_fs.c @@ -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; } diff --git a/source4/dsdb/kcc/kcc_drs_replica_info.c b/source4/dsdb/kcc/kcc_drs_replica_info.c index ac22312..52c36ca 100644 --- a/source4/dsdb/kcc/kcc_drs_replica_info.c +++ b/source4/dsdb/kcc/kcc_drs_replica_info.c @@ -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; diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c index 4db4d4e..34bae96 100644 --- a/source4/dsdb/kcc/kcc_periodic.c +++ b/source4/dsdb/kcc/kcc_periodic.c @@ -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; } diff --git a/source4/dsdb/repl/drepl_notify.c b/source4/dsdb/repl/drepl_notify.c index 905fe5f..3f2c851 100644 --- a/source4/dsdb/repl/drepl_notify.c +++ b/source4/dsdb/repl/drepl_notify.c @@ -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; } } diff --git a/source4/dsdb/repl/drepl_out_pull.c b/source4/dsdb/repl/drepl_out_pull.c index 58d8778..e64c91d 100644 --- a/source4/dsdb/repl/drepl_out_pull.c +++ b/source4/dsdb/repl/drepl_out_pull.c @@ -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; } } diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c index 7be069e..8c85ef6 100644 --- a/source4/dsdb/repl/drepl_partitions.c +++ b/source4/dsdb/repl/drepl_partitions.c @@ -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); diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 147e357..a71c49b 100644 --- a/source4/dsdb/samdb/ldb_modules/util.c +++ b/source4/dsdb/samdb/ldb_modules/util.c @@ -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; } diff --git a/source4/rpc_server/drsuapi/updaterefs.c b/source4/rpc_server/drsuapi/updaterefs.c index ae87117..6fdbf2e 100644 --- a/source4/rpc_server/drsuapi/updaterefs.c +++ b/source4/rpc_server/drsuapi/updaterefs.c @@ -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))); } -- Samba Shared Repository