r17362: session_info and smbpid are available from the ntvfs_handle
authorStefan Metzmacher <metze@samba.org>
Tue, 1 Aug 2006 10:58:01 +0000 (10:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:15:19 +0000 (14:15 -0500)
so we don't need them on the pvfs_file struct.

also we don't need to check is the handle has the correct session
as this is job of the frontend server

metze
(This used to be commit c83501335f245ac73b9d53c12efee3d46b8c5b05)

source4/ntvfs/posix/pvfs_flush.c
source4/ntvfs/posix/pvfs_open.c
source4/ntvfs/posix/vfs_posix.h

index 0f5a07071b879cea609187a006a8b23e98616ba3..a9f36d1ae1c6111abf14668ef9e93a477de98cfd 100644 (file)
@@ -67,7 +67,7 @@ NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs,
                 * for the given SMBPID
                 */
                for (f=pvfs->files.list;f;f=f->next) {
-                       if (f->smbpid != req->smbpid) continue;
+                       if (f->ntvfs->smbpid != req->smbpid) continue;
 
                        pvfs_flush_file(pvfs, f);
                }
index b0d0348240dea550c577125ad6a38d5502ca5d7a..d8f30476ac4a7d6bd7357c015bc4c8184629b02a 100644 (file)
@@ -43,11 +43,6 @@ struct pvfs_file *pvfs_find_fd(struct pvfs_state *pvfs,
        f = talloc_get_type(p, struct pvfs_file);
        if (!f) return NULL;
 
-       if (req->session_info != f->session_info) {
-               DEBUG(2,("pvfs_find_fd: attempt to use wrong session for handle %p\n",h));
-               return NULL;
-       }
-
        return f;
 }
 
@@ -256,8 +251,6 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
        }
 
        f->ntvfs         = h;
-       f->session_info  = req->session_info;
-       f->smbpid        = req->smbpid;
        f->pvfs          = pvfs;
        f->pending_list  = NULL;
        f->lock_count    = 0;
@@ -690,8 +683,6 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
        }
 
        f->ntvfs             = h;
-       f->session_info      = req->session_info;
-       f->smbpid            = req->smbpid;
        f->pvfs              = pvfs;
        f->pending_list      = NULL;
        f->lock_count        = 0;
@@ -861,8 +852,8 @@ static NTSTATUS pvfs_open_deny_dos(struct ntvfs_module_context *ntvfs,
        */
        for (f2=pvfs->files.list;f2;f2=f2->next) {
                if (f2 != f &&
-                   f2->session_info == req->session_info &&
-                   f2->smbpid == req->smbpid &&
+                   f2->ntvfs->session_info == req->session_info &&
+                   f2->ntvfs->smbpid == req->smbpid &&
                    (f2->handle->create_options & 
                     (NTCREATEX_OPTIONS_PRIVATE_DENY_DOS |
                      NTCREATEX_OPTIONS_PRIVATE_DENY_FCB)) &&
@@ -1120,8 +1111,6 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
        }
 
        f->ntvfs         = h;
-       f->session_info  = req->session_info;
-       f->smbpid        = req->smbpid;
        f->pvfs          = pvfs;
        f->pending_list  = NULL;
        f->lock_count    = 0;
@@ -1344,7 +1333,7 @@ NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs,
 
        for (f=pvfs->files.list;f;f=next) {
                next = f->next;
-               if (f->session_info == req->session_info) {
+               if (f->ntvfs->session_info == req->session_info) {
                        talloc_free(f);
                }
        }
@@ -1364,8 +1353,8 @@ NTSTATUS pvfs_exit(struct ntvfs_module_context *ntvfs,
 
        for (f=pvfs->files.list;f;f=next) {
                next = f->next;
-               if (f->session_info == req->session_info &&
-                   f->smbpid == req->smbpid) {
+               if (f->ntvfs->session_info == req->session_info &&
+                   f->ntvfs->smbpid == req->smbpid) {
                        talloc_free(f);
                }
        }
index 8d3e86fff17c89047c7dda963532182fc623d861..a788ddd19c10feb5d1ffda076643026e4c06cf45 100644 (file)
@@ -161,14 +161,6 @@ struct pvfs_file {
        uint32_t share_access;
        uint32_t access_mask;
 
-       /* we need to remember the session it was opened on,
-          as it is illegal to operate on someone elses fnum */
-       struct auth_session_info *session_info;
-
-       /* we need to remember the client pid that 
-          opened the file so SMBexit works */
-       uint16_t smbpid;
-
        /* a list of pending locks - used for locking cancel operations */
        struct pvfs_pending_lock *pending_list;