]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Use C99 initializer in dsdb util_trusts
authorAndreas Schneider <asn@samba.org>
Mon, 14 Jan 2019 12:07:28 +0000 (13:07 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 29 Apr 2019 16:04:28 +0000 (16:04 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/dsdb/common/util_trusts.c

index 4fe20496ed8e388d46a1e132c04401e511777707..d2183911470dafc1ee766fa233f733d8ca3765ea 100644 (file)
@@ -382,7 +382,9 @@ static NTSTATUS dsdb_trust_parse_crossref_info(TALLOC_CTX *mem_ctx,
        const char *dns = NULL;
        const char *netbios = NULL;
        struct ldb_dn *nc_dn = NULL;
-       struct dom_sid sid = {};
+       struct dom_sid sid = {
+               .num_auths = 0,
+       };
        NTSTATUS status;
 
        *_tdo = NULL;
@@ -621,11 +623,11 @@ static int dns_cmp(const char *s1, const char *s2)
        size_t l1 = 0;
        const char *p1 = NULL;
        size_t num_comp1 = 0;
-       uint16_t comp1[UINT8_MAX] = {};
+       uint16_t comp1[UINT8_MAX] = {0};
        size_t l2 = 0;
        const char *p2 = NULL;
        size_t num_comp2 = 0;
-       uint16_t comp2[UINT8_MAX] = {};
+       uint16_t comp2[UINT8_MAX] = {0};
        size_t i;
 
        if (s1 != NULL) {
@@ -1011,8 +1013,12 @@ NTSTATUS dsdb_trust_xref_forest_info(TALLOC_CTX *mem_ctx,
                const char *dns = NULL;
                const char *netbios = NULL;
                struct ldb_dn *nc_dn = NULL;
-               struct dom_sid sid = {};
-               struct lsa_ForestTrustRecord e = {};
+               struct dom_sid sid = {
+                       .num_auths = 0,
+               };
+               struct lsa_ForestTrustRecord e = {
+                       .flags = 0,
+               };
                struct lsa_ForestTrustDomainInfo *d = NULL;
                struct lsa_StringLarge *t = NULL;
                bool match = false;
@@ -1086,7 +1092,9 @@ NTSTATUS dsdb_trust_xref_forest_info(TALLOC_CTX *mem_ctx,
        for (i=0; (tln_el != NULL) && i < tln_el->num_values; i++) {
                const struct ldb_val *v = &tln_el->values[i];
                const char *dns = (const char *)v->data;
-               struct lsa_ForestTrustRecord e = {};
+               struct lsa_ForestTrustRecord e = {
+                       .flags = 0,
+               };
                struct lsa_StringLarge *t = NULL;
                bool match = false;
                NTSTATUS status;
@@ -2037,7 +2045,9 @@ NTSTATUS dsdb_trust_merge_forest_info(TALLOC_CTX *mem_ctx,
         */
        for (ni = 0; ni < nfti->count; ni++) {
                const struct lsa_ForestTrustRecord *nftr = nfti->entries[ni];
-               struct lsa_ForestTrustRecord tftr = {};
+               struct lsa_ForestTrustRecord tftr = {
+                       .flags = 0,
+               };
                const char *ndns = NULL;
                bool ignore_new = false;
                bool found_old = false;
@@ -2152,7 +2162,9 @@ NTSTATUS dsdb_trust_merge_forest_info(TALLOC_CTX *mem_ctx,
         */
        for (ni = 0; ni < nfti->count; ni++) {
                const struct lsa_ForestTrustRecord *nftr = nfti->entries[ni];
-               struct lsa_ForestTrustRecord tftr = {};
+               struct lsa_ForestTrustRecord tftr = {
+                       .flags = 0,
+               };
                const struct lsa_ForestTrustDomainInfo *nd = NULL;
                const char *ndns = NULL;
                const char *nnbt = NULL;
@@ -2648,13 +2660,19 @@ NTSTATUS dsdb_trust_get_incoming_passwords(struct ldb_message *msg,
                                           struct samr_Password **_previous)
 {
        TALLOC_CTX *frame = talloc_stackframe();
-       struct samr_Password __current = {};
-       struct samr_Password __previous = {};
+       struct samr_Password __current = {
+               .hash = {0},
+       };
+       struct samr_Password __previous = {
+               .hash = {0},
+       };
        struct samr_Password *current = NULL;
        struct samr_Password *previous = NULL;
        const struct ldb_val *blob = NULL;
        enum ndr_err_code ndr_err;
-       struct trustAuthInOutBlob incoming = {};
+       struct trustAuthInOutBlob incoming = {
+               .count = 0,
+       };
        uint32_t i;
 
        if (_current != NULL) {