From d66dc816716c63311c4e1faad089c3a3667b91c8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 23 Dec 2022 17:23:36 +0100 Subject: [PATCH] smbd: Fix qfileinfo profiling This ran under qpathinfo profiling Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/smbd/smb1_trans2.c | 68 +++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 6f9a5075ed3..0d7ffebd024 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -2355,6 +2355,46 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd return; } +static void call_trans2qpathinfo( + connection_struct *conn, + struct smb_request *req, + char **pparams, + int total_params, + char **ppdata, + int total_data, + unsigned int max_data_bytes) +{ + call_trans2qfilepathinfo( + conn, + req, + TRANSACT2_QPATHINFO, + pparams, + total_params, + ppdata, + total_data, + max_data_bytes); +} + +static void call_trans2qfileinfo( + connection_struct *conn, + struct smb_request *req, + char **pparams, + int total_params, + char **ppdata, + int total_data, + unsigned int max_data_bytes) +{ + call_trans2qfilepathinfo( + conn, + req, + TRANSACT2_QFILEINFO, + pparams, + total_params, + ppdata, + total_data, + max_data_bytes); +} + static void handle_trans2setfilepathinfo_result( connection_struct *conn, struct smb_request *req, @@ -3160,17 +3200,35 @@ static void handle_trans2(connection_struct *conn, struct smb_request *req, } case TRANSACT2_QPATHINFO: - case TRANSACT2_QFILEINFO: { START_PROFILE(Trans2_qpathinfo); - call_trans2qfilepathinfo(conn, req, state->call, - &state->param, state->total_param, - &state->data, state->total_data, - state->max_data_return); + call_trans2qpathinfo( + conn, + req, + &state->param, + state->total_param, + &state->data, + state->total_data, + state->max_data_return); END_PROFILE(Trans2_qpathinfo); break; } + case TRANSACT2_QFILEINFO: + { + START_PROFILE(Trans2_qfileinfo); + call_trans2qfileinfo( + conn, + req, + &state->param, + state->total_param, + &state->data, + state->total_data, + state->max_data_return); + END_PROFILE(Trans2_qfileinfo); + break; + } + case TRANSACT2_SETPATHINFO: { START_PROFILE(Trans2_setpathinfo);