]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Remove &data_blob_null refs
authorVolker Lendecke <vl@samba.org>
Tue, 30 Dec 2025 09:34:49 +0000 (10:34 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 20 Jan 2026 11:53:34 +0000 (11:53 +0000)
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 <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
libcli/auth/tests/ntlm_check.c
source4/kdc/ad_claims.c
source4/kdc/pac-glue.c

index 79b8ec9e28c95cfe5a17518386e9660d449443d0..b637f2c50a3de10134d030dc930e25b73baddfe6 100644 (file)
@@ -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,
index f2fd6b4a5fb4c4e8baf64a606ff783b5b3575ac6..207781121248c95a72c3731fa42c8415ad849d10 100644 (file)
@@ -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) {
index e8b881cd33be87033fb8a928e33c500ba7e94bf8..09ede5896f06a3cdf1b644b413329f75ab8b1f48 100644 (file)
@@ -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;
        }