]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: remove unused session,tcon parameters from smbd_smb2_send_oplock_break()
authorStefan Metzmacher <metze@samba.org>
Tue, 19 May 2020 12:10:21 +0000 (14:10 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 8 Jul 2020 15:54:39 +0000 (15:54 +0000)
They are no longer used. However we'll make use of
op->compat->vuid in the next commits, as the session id should be part
of oplock breaks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source3/smbd/globals.h
source3/smbd/smb2_break.c
source3/smbd/smb2_server.c

index 2a963439bef2017a7df783b65a4f09330eb6e033..3f7aa94ce3cb5c1dabc3051ee29831da1d9e2182 100644 (file)
@@ -258,8 +258,6 @@ NTSTATUS smbd_smb2_request_done_ex(struct smbd_smb2_request *req,
        smbd_smb2_request_done_ex(req, NT_STATUS_OK, body, dyn, __location__)
 
 NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_connection *xconn,
-                                    struct smbXsrv_session *session,
-                                    struct smbXsrv_tcon *tcon,
                                     struct smbXsrv_open *op,
                                     uint8_t oplock_level);
 NTSTATUS smbd_smb2_send_lease_break(struct smbXsrv_connection *xconn,
index ae6b9214b229c46e8091973a5c82ae5f071828f3..2ab55aa872042810eb275aa927e50384c6686520 100644 (file)
@@ -444,9 +444,6 @@ void send_break_message_smb2(files_struct *fsp,
 {
        NTSTATUS status;
        struct smbXsrv_connection *xconn = NULL;
-       struct smbXsrv_session *session = NULL;
-       struct timeval tv = timeval_current();
-       NTTIME now = timeval_to_nttime(&tv);
 
        /*
         * TODO: in future we should have a better algorithm
@@ -455,28 +452,21 @@ void send_break_message_smb2(files_struct *fsp,
         */
        xconn = fsp->conn->sconn->client->connections;
 
-       status = smb2srv_session_lookup_conn(xconn,
-                                            fsp->vuid,
-                                            now,
-                                            &session);
-       if (NT_STATUS_EQUAL(status, NT_STATUS_USER_SESSION_DELETED) ||
-           (session == NULL))
-       {
-
-               DEBUG(10,("send_break_message_smb2: skip oplock break "
-                       "for file %s, %s, smb2 level %u session %llu not found\n",
-                       fsp_str_dbg(fsp),
-                       fsp_fnum_dbg(fsp),
-                       (unsigned int)break_to,
-                       (unsigned long long)fsp->vuid));
+       if (!NT_STATUS_IS_OK(fsp->op->status)) {
+               DBG_DEBUG("skip oplock break for file %s, %s, "
+                         "smb2 level %u fsp status=%s\n",
+                         fsp_str_dbg(fsp),
+                         fsp_fnum_dbg(fsp),
+                         (unsigned int)break_to,
+                         nt_errstr(fsp->op->status));
                return;
        }
 
-       DEBUG(10,("send_break_message_smb2: sending oplock break "
-               "for file %s, %s, smb2 level %u\n",
-               fsp_str_dbg(fsp),
-               fsp_fnum_dbg(fsp),
-               (unsigned int)break_to ));
+       DBG_DEBUG("sending oplock break "
+                 "for file %s, %s, smb2 level %u\n",
+                 fsp_str_dbg(fsp),
+                 fsp_fnum_dbg(fsp),
+                 (unsigned int)break_to);
 
        if (fsp->oplock_type == LEASE_OPLOCK) {
                uint32_t break_flags = 0;
@@ -500,8 +490,6 @@ void send_break_message_smb2(files_struct *fsp,
                smb2_oplock_level = (break_to & SMB2_LEASE_READ) ?
                        SMB2_OPLOCK_LEVEL_II : SMB2_OPLOCK_LEVEL_NONE;
                status = smbd_smb2_send_oplock_break(xconn,
-                                                    session,
-                                                    fsp->conn->tcon,
                                                     fsp->op,
                                                     smb2_oplock_level);
        }
index 42805ab9760f6179518531ca7743798f2e1defe0..86354098b958b43d69e993b63f9eb078df21d979 100644 (file)
@@ -3573,8 +3573,6 @@ static NTSTATUS smbd_smb2_send_break(struct smbXsrv_connection *xconn,
 }
 
 NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_connection *xconn,
-                                    struct smbXsrv_session *session,
-                                    struct smbXsrv_tcon *tcon,
                                     struct smbXsrv_open *op,
                                     uint8_t oplock_level)
 {