smbd: Remove "share_access" from files_struct
authorVolker Lendecke <vl@samba.org>
Thu, 25 Jul 2019 14:15:46 +0000 (16:15 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2019 21:49:29 +0000 (21:49 +0000)
Nobody used this (except vfs_gpfs, which did not need it really). If
you *really* need this, you can always look in locking.tdb, but this
should never happen in any hot code path, as no runtime decisions are
made on the share access after the open is done.

Bump VFS interface number to 42.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/vfs.h
source3/smbd/durable.c
source3/smbd/files.c
source3/smbd/open.c

index 4c778839880f2bffd07f9d63533667607b54e76d..268f286916c536c040e93b63576bf10ce10ce132 100644 (file)
 /* Version 41 - Remove "blocking_lock" parameter from
                 SMB_VFS_BRL_LOCK_WINDOWS */
 /* Version 41 - Remove "msg_ctx" parameter from SMB_VFS_BRL_UNLOCK_WINDOWS */
+/* Bump to version 42, Samba 4.12 will ship with that */
+/* Version 42 - Remove share_access member from struct files_struct */
 
-#define SMB_VFS_INTERFACE_VERSION 41
+#define SMB_VFS_INTERFACE_VERSION 42
 
 /*
     All intercepted VFS operations must be declared as static functions inside module source
@@ -333,8 +335,6 @@ typedef struct files_struct {
        struct write_cache *wcp;
        struct timeval open_time;
        uint32_t access_mask;           /* NTCreateX access bits (FILE_READ_DATA etc.) */
-       uint32_t share_access;          /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */
-
        bool kernel_share_modes_taken;
 
        bool update_write_time_triggered;
index 4aa5a2d619ed84b24f70dc8ddd2bb6825d8e9398..db02c229edda901842a6d86ab5b04b4153353e66 100644 (file)
@@ -663,7 +663,6 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
        fsp->vuid = smb1req->vuid;
        fsp->open_time = e->time;
        fsp->access_mask = e->access_mask;
-       fsp->share_access = e->share_access;
        fsp->can_read = ((fsp->access_mask & (FILE_READ_DATA)) != 0);
        fsp->can_write = ((fsp->access_mask & (FILE_WRITE_DATA|FILE_APPEND_DATA)) != 0);
        fsp->fnum = op->local_id;
index 46fc4191950a174febbe5771e2720ed187eaf046..a445b9881bfaa63856fbf3f7b2e6cfd41343359d 100644 (file)
@@ -706,7 +706,6 @@ NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from,
        to->vuid = from->vuid;
        to->open_time = from->open_time;
        to->access_mask = access_mask;
-       to->share_access = share_access;
        to->oplock_type = from->oplock_type;
        to->can_lock = from->can_lock;
        to->can_read = ((access_mask & FILE_READ_DATA) != 0);
index d599b867cb40beea1897dbbed7067af0f7409c32..850b69fcba8c48317fdfe8ad3951d847b712bd2f 100644 (file)
@@ -3249,7 +3249,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
        }
 
        fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
-       fsp->share_access = share_access;
        fsp->fh->private_options = private_flags;
        fsp->access_mask = open_access_mask; /* We change this to the
                                              * requested access_mask after
@@ -3675,7 +3674,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                lck,
                oplock_request,
                lease,
-               fsp->share_access,
+               share_access,
                fsp->access_mask);
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(lck);
@@ -4105,7 +4104,6 @@ static NTSTATUS open_directory(connection_struct *conn,
        fsp->can_read = False;
        fsp->can_write = False;
 
-       fsp->share_access = share_access;
        fsp->fh->private_options = 0;
        /*
         * According to Samba4, SEC_FILE_READ_ATTRIBUTE is always granted,
@@ -4211,7 +4209,7 @@ static NTSTATUS open_directory(connection_struct *conn,
                get_current_uid(conn),
                req ? req->mid : 0,
                NO_OPLOCK,
-               fsp->share_access,
+               share_access,
                fsp->access_mask,
                NULL,
                NULL);