From b4a7b7a8889737e2891fc1176feabd4ce47f2737 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 14 May 2007 12:16:20 +0000 Subject: r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and replace all data_blob(NULL, 0) calls. (This used to be commit 3d3d61687ef00181f4f04e001d42181d93ac931e) --- source3/smbd/negprot.c | 2 +- source3/smbd/seal.c | 22 +++++++++++----------- source3/smbd/service.c | 4 ++-- source3/smbd/sesssetup.c | 20 ++++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 1722c81d2a..12b1e84600 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -229,7 +229,7 @@ static DATA_BLOB negprot_spnego(void) strlower_m(myname); asprintf(&host_princ_s, "cifs/%s@%s", myname, lp_realm()); if (host_princ_s == NULL) { - blob = data_blob(NULL, 0); + blob = data_blob_null; return blob; } blob = spnego_gen_negTokenInit(guid, OIDs_krb5, host_princ_s); diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c index c4d60b0a60..5d8ef9b63c 100644 --- a/source3/smbd/seal.c +++ b/source3/smbd/seal.c @@ -346,8 +346,8 @@ static NTSTATUS srv_enc_spnego_gss_negotiate(unsigned char **ppdata, size_t *p_d OM_uint32 flags = 0; gss_buffer_desc in_buf, out_buf; struct smb_tran_enc_state_gss *gss_state; - DATA_BLOB auth_reply = data_blob(NULL,0); - DATA_BLOB response = data_blob(NULL,0); + DATA_BLOB auth_reply = data_blob_null; + DATA_BLOB response = data_blob_null; NTSTATUS status; if (!partial_srv_trans_enc_ctx) { @@ -419,8 +419,8 @@ static NTSTATUS srv_enc_spnego_gss_negotiate(unsigned char **ppdata, size_t *p_d static NTSTATUS srv_enc_ntlm_negotiate(unsigned char **ppdata, size_t *p_data_size, DATA_BLOB secblob, BOOL spnego_wrap) { NTSTATUS status; - DATA_BLOB chal = data_blob(NULL, 0); - DATA_BLOB response = data_blob(NULL, 0); + DATA_BLOB chal = data_blob_null; + DATA_BLOB response = data_blob_null; status = make_srv_encryption_context(SMB_TRANS_ENC_NTLM, &partial_srv_trans_enc_ctx); if (!NT_STATUS_IS_OK(status)) { @@ -459,8 +459,8 @@ static NTSTATUS srv_enc_spnego_negotiate(connection_struct *conn, size_t *p_param_size) { NTSTATUS status; - DATA_BLOB blob = data_blob(NULL,0); - DATA_BLOB secblob = data_blob(NULL, 0); + DATA_BLOB blob = data_blob_null; + DATA_BLOB secblob = data_blob_null; BOOL got_kerberos_mechanism = False; blob = data_blob_const(*ppdata, *p_data_size); @@ -514,10 +514,10 @@ static NTSTATUS srv_enc_spnego_ntlm_auth(connection_struct *conn, size_t *p_param_size) { NTSTATUS status; - DATA_BLOB blob = data_blob(NULL,0); - DATA_BLOB auth = data_blob(NULL,0); - DATA_BLOB auth_reply = data_blob(NULL,0); - DATA_BLOB response = data_blob(NULL,0); + DATA_BLOB blob = data_blob_null; + DATA_BLOB auth = data_blob_null; + DATA_BLOB auth_reply = data_blob_null; + DATA_BLOB response = data_blob_null; struct smb_srv_trans_enc_ctx *ec = partial_srv_trans_enc_ctx; /* We must have a partial context here. */ @@ -567,7 +567,7 @@ static NTSTATUS srv_enc_raw_ntlm_auth(connection_struct *conn, { NTSTATUS status; DATA_BLOB blob = data_blob_const(*ppdata, *p_data_size); - DATA_BLOB response = data_blob(NULL,0); + DATA_BLOB response = data_blob_null; struct smb_srv_trans_enc_ctx *ec; if (!partial_srv_trans_enc_ctx) { diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 79c618e7b3..6d2cdff594 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -1230,7 +1230,7 @@ connection_struct *make_connection(const char *service_in, DATA_BLOB password, if (strequal(service_in,HOMES_NAME)) { if(lp_security() != SEC_SHARE) { - DATA_BLOB no_pw = data_blob(NULL, 0); + DATA_BLOB no_pw = data_blob_null; if (vuser->homes_snum == -1) { DEBUG(2, ("[homes] share not available for " "this user because it was not found " @@ -1266,7 +1266,7 @@ connection_struct *make_connection(const char *service_in, DATA_BLOB password, } else if ((lp_security() != SEC_SHARE) && (vuser->homes_snum != -1) && strequal(service_in, lp_servicename(vuser->homes_snum))) { - DATA_BLOB no_pw = data_blob(NULL, 0); + DATA_BLOB no_pw = data_blob_null; DEBUG(5, ("making a connection to 'homes' service [%s] " "created at session setup time\n", service_in)); return make_connection_snum(vuser->homes_snum, diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index d6cdf777d8..dcff27f70c 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -177,7 +177,7 @@ static BOOL make_krb5_skew_error(DATA_BLOB *pblob_out) char *host_princ_s = NULL; BOOL ret = False; - *pblob_out = data_blob(NULL,0); + *pblob_out = data_blob_null; initialize_krb5_error_table(); kerr = krb5_init_context(&context); @@ -243,9 +243,9 @@ static int reply_spnego_kerberos(connection_struct *conn, PAC_DATA *pac_data; DATA_BLOB ap_rep, ap_rep_wrapped, response; auth_serversupplied_info *server_info = NULL; - DATA_BLOB session_key = data_blob(NULL, 0); + DATA_BLOB session_key = data_blob_null; uint8 tok_id[2]; - DATA_BLOB nullblob = data_blob(NULL, 0); + DATA_BLOB nullblob = data_blob_null; fstring real_username; BOOL map_domainuser_to_guest = False; BOOL username_was_mapped; @@ -539,7 +539,7 @@ static int reply_spnego_kerberos(connection_struct *conn, if (NT_STATUS_IS_OK(ret)) { ap_rep_wrapped = spnego_gen_krb5_wrap(ap_rep, TOK_ID_KRB_AP_REP); } else { - ap_rep_wrapped = data_blob(NULL, 0); + ap_rep_wrapped = data_blob_null; } response = spnego_gen_auth_response(&ap_rep_wrapped, ret, OID_KERBEROS5_OLD); reply_sesssetup_blob(conn, inbuf, outbuf, response, ret); @@ -582,7 +582,7 @@ static BOOL reply_spnego_ntlmssp(connection_struct *conn, char *inbuf, char *out if (NT_STATUS_IS_OK(nt_status)) { int sess_vuid; - DATA_BLOB nullblob = data_blob(NULL, 0); + DATA_BLOB nullblob = data_blob_null; DATA_BLOB session_key = data_blob((*auth_ntlmssp_state)->ntlmssp_state->session_key.data, (*auth_ntlmssp_state)->ntlmssp_state->session_key.length); /* register_vuid keeps the server info */ @@ -748,9 +748,9 @@ static int reply_spnego_auth(connection_struct *conn, char *inbuf, char *outbuf, DATA_BLOB blob1, AUTH_NTLMSSP_STATE **auth_ntlmssp_state) { - DATA_BLOB auth = data_blob(NULL,0); - DATA_BLOB auth_reply = data_blob(NULL,0); - DATA_BLOB secblob = data_blob(NULL,0); + DATA_BLOB auth = data_blob_null; + DATA_BLOB auth_reply = data_blob_null; + DATA_BLOB secblob = data_blob_null; NTSTATUS status = NT_STATUS_INVALID_PARAMETER; if (!spnego_parse_auth(blob1, &auth)) { @@ -1089,7 +1089,7 @@ static int reply_sesssetup_and_X_spnego(connection_struct *conn, char *inbuf, } if (!vuser) { - vuid = register_vuid(NULL, data_blob(NULL, 0), data_blob(NULL, 0), NULL); + vuid = register_vuid(NULL, data_blob_null, data_blob_null, NULL); if (vuid == UID_FIELD_INVALID ) { data_blob_free(&blob1); return ERROR_NT(nt_status_squash(NT_STATUS_INVALID_PARAMETER)); @@ -1509,7 +1509,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf, if (server_info->user_session_key.data) { session_key = data_blob(server_info->user_session_key.data, server_info->user_session_key.length); } else { - session_key = data_blob(NULL, 0); + session_key = data_blob_null; } data_blob_clear_free(&plaintext_password); -- cgit