From: Volker Lendecke Date: Thu, 25 Jul 2019 14:15:46 +0000 (+0200) Subject: smbd: Remove "share_access" from files_struct X-Git-Tag: tdb-1.4.2~293 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=13921645c4856ddc325a0f8c8a64d0bbecab119d;p=thirdparty%2Fsamba.git smbd: Remove "share_access" from files_struct 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 4c778839880..268f286916c 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -269,8 +269,10 @@ /* 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; diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c index 4aa5a2d619e..db02c229edd 100644 --- a/source3/smbd/durable.c +++ b/source3/smbd/durable.c @@ -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; diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 46fc4191950..a445b9881bf 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d599b867cb4..850b69fcba8 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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);