From: Volker Lendecke Date: Tue, 30 Dec 2025 09:34:49 +0000 (+0100) Subject: lib: Remove &data_blob_null refs X-Git-Tag: tdb-1.4.15~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74858220d9fdcb26244d9fb5a0252c98e3a46e2d;p=thirdparty%2Fsamba.git lib: Remove &data_blob_null refs The next patch will remove the data_blob_null global constant. The APIs here are a bit weird in that they don't work fine with a NULL pointer but require a reference to a NULL blob. But that's few enough to add the special case in the callers. Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/libcli/auth/tests/ntlm_check.c b/libcli/auth/tests/ntlm_check.c index 79b8ec9e28c..b637f2c50a3 100644 --- a/libcli/auth/tests/ntlm_check.c +++ b/libcli/auth/tests/ntlm_check.c @@ -350,6 +350,7 @@ static void test_ntlmv2_only_ntlm_and_lanman(void **state) static void test_ntlmv2_only_ntlm_once(void **state) { DATA_BLOB user_sess_key, lm_sess_key; + DATA_BLOB null_blob = {}; struct ntlm_state *ntlm_state = talloc_get_type_abort(*state, struct ntlm_state); @@ -359,7 +360,7 @@ static void test_ntlmv2_only_ntlm_once(void **state) NTLM_AUTH_NTLMV2_ONLY, 0, &ntlm_state->challenge, - &data_blob_null, + &null_blob, &ntlm_state->ntlm, ntlm_state->username, ntlm_state->username, diff --git a/source4/kdc/ad_claims.c b/source4/kdc/ad_claims.c index f2fd6b4a5fb..20778112124 100644 --- a/source4/kdc/ad_claims.c +++ b/source4/kdc/ad_claims.c @@ -907,6 +907,7 @@ static int get_all_claims(struct ldb_context *ldb, DATA_BLOB source_syntax; const char *attribute = NULL; const struct ldb_val *name = NULL; + const struct ldb_val null_name = {}; if (claim_attribute_source == NULL) { continue; @@ -964,7 +965,7 @@ static int get_all_claims(struct ldb_context *ldb, name = ldb_msg_find_ldb_val(res->msgs[i], "name"); if (name == NULL) { - name = &data_blob_null; + name = &null_name; } ad_claims[ad_claims_count++] = (struct ad_claim_info) { diff --git a/source4/kdc/pac-glue.c b/source4/kdc/pac-glue.c index e8b881cd33b..09ede5896f0 100644 --- a/source4/kdc/pac-glue.c +++ b/source4/kdc/pac-glue.c @@ -2804,6 +2804,9 @@ krb5_error_code samba_kdc_update_pac(TALLOC_CTX *mem_ctx, const struct auth_user_info_dc *deleg_info_dc = NULL; struct auth_claims deleg_claims = {}; size_t i = 0; +#ifdef SAMBA4_USES_HEIMDAL + DATA_BLOB null_blob = {}; +#endif if (server_audit_info_out != NULL) { *server_audit_info_out = NULL; @@ -3160,21 +3163,21 @@ krb5_error_code samba_kdc_update_pac(TALLOC_CTX *mem_ctx, /* Not needed with MIT Kerberos */ code = pac_blobs_replace_existing(pac_blobs, PAC_TYPE_LOGON_NAME, - &data_blob_null); + &null_blob); if (code != 0) { goto done; } code = pac_blobs_replace_existing(pac_blobs, PAC_TYPE_SRV_CHECKSUM, - &data_blob_null); + &null_blob); if (code != 0) { goto done; } code = pac_blobs_replace_existing(pac_blobs, PAC_TYPE_KDC_CHECKSUM, - &data_blob_null); + &null_blob); if (code != 0) { goto done; }