]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Slightly simplify call_trans2qpipeinfo()
authorVolker Lendecke <vl@samba.org>
Thu, 21 Apr 2022 13:48:09 +0000 (15:48 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 26 Apr 2022 22:38:59 +0000 (22:38 +0000)
Pass down "fsp" and "info_level", no need to parse this inside
call_trans2qpipeinfo() when the caller also has to do it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 26 22:38:59 UTC 2022 on sn-devel-184

source3/smbd/smb1_trans2.c

index 8142729f03c7b33067775d7e291ae18be65d1f21..5edba32283996a9277545102b763e2b9b46f2d50 100644 (file)
@@ -1862,6 +1862,8 @@ static void call_trans2setfsinfo(connection_struct *conn,
 
 static void call_trans2qpipeinfo(connection_struct *conn,
                                 struct smb_request *req,
+                                files_struct *fsp,
+                                uint16_t info_level,
                                 unsigned int tran_call,
                                 char **pparams, int total_params,
                                 char **ppdata, int total_data,
@@ -1871,27 +1873,12 @@ static void call_trans2qpipeinfo(connection_struct *conn,
        char *pdata = *ppdata;
        unsigned int data_size = 0;
        unsigned int param_size = 2;
-       uint16_t info_level;
-       files_struct *fsp;
-
-       if (!params) {
-               reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
-               return;
-       }
-
-       if (total_params < 4) {
-               reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
-               return;
-       }
 
-       fsp = file_fsp(req, SVAL(params,0));
        if (!fsp_is_np(fsp)) {
                reply_nterror(req, NT_STATUS_INVALID_HANDLE);
                return;
        }
 
-       info_level = SVAL(params,2);
-
        *pparams = (char *)SMB_REALLOC(*pparams,2);
        if (*pparams == NULL) {
                reply_nterror(req, NT_STATUS_NO_MEMORY);
@@ -1973,17 +1960,24 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
                        return;
                }
 
+               fsp = file_fsp(req, SVAL(params,0));
+               info_level = SVAL(params,2);
+
                if (IS_IPC(conn)) {
-                       call_trans2qpipeinfo(conn, req, tran_call,
-                                            pparams, total_params,
-                                            ppdata, total_data,
-                                            max_data_bytes);
+                       call_trans2qpipeinfo(
+                               conn,
+                               req,
+                               fsp,
+                               info_level,
+                               tran_call,
+                               pparams,
+                               total_params,
+                               ppdata,
+                               total_data,
+                               max_data_bytes);
                        return;
                }
 
-               fsp = file_fsp(req, SVAL(params,0));
-               info_level = SVAL(params,2);
-
                DEBUG(3,("call_trans2qfilepathinfo: TRANSACT2_QFILEINFO: level = %d\n", info_level));
 
                if (INFO_LEVEL_IS_UNIX(info_level)) {