vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()
authorRalph Boehme <slow@samba.org>
Fri, 2 Oct 2020 15:29:58 +0000 (17:29 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 2 Oct 2020 21:00:05 +0000 (21:00 +0000)
This was supposed to be a shortcut to avoid passing dirfsp around as an explicit
function argument throughout the whole codebase when the new VFS design idea was
based on using *AT functions throughout the VFS.

Now that we've opted for basing the VFS on handles and *AT functions will only
be used in a much more limitted extent, it makes sense to remove this internal
dirfsp reference, otherwise the combination of internal fsp->dirfsp and
smb_fname->fsp is going to be a tough to wrap your head around.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  2 21:00:05 UTC 2020 on sn-devel-184

24 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/lib/adouble.c
source3/modules/vfs_default.c
source3/modules/vfs_fruit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/modules/vfs_worm.c
source3/printing/nt_printing.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/dosmode.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/proto.h
source3/smbd/reply.c
source3/smbd/smb2_create.c
source3/smbd/trans2.c
source3/smbd/vfs.c
source3/utils/net_vfs.c

index 0a6ca4d9200d6475dfdb0f75ee093e9b0342e68c..90ee82ab258fa56cd7ba11b6f2123da16006bd79 100644 (file)
@@ -204,7 +204,6 @@ static int skel_openat(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
                                 struct smb_request *req,
-                                struct files_struct **dirfsp,
                                 struct smb_filename *smb_fname,
                                 uint32_t access_mask,
                                 uint32_t share_access,
index 677af2217bf17cc4a28452ff8affeedce800b1a2..d48ac47443b95fe880f2f0d160b3cb4870c1a3ab 100644 (file)
@@ -212,7 +212,6 @@ static int skel_openat(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
                                 struct smb_request *req,
-                                struct files_struct **dirfsp,
                                 struct smb_filename *smb_fname,
                                 uint32_t access_mask,
                                 uint32_t share_access,
@@ -231,7 +230,6 @@ static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
 {
        return SMB_VFS_NEXT_CREATE_FILE(handle,
                                        req,
-                                       dirfsp,
                                        smb_fname,
                                        access_mask,
                                        share_access,
index 81e9a9f871627defb77bd7e229bb56a0bb8cdf97..b282e2a361bbde3dd29edcd88661edf942c9d4c7 100644 (file)
                otherwise.
  * Change to Version 44 - will ship with 4.14.
  * Version 44 - Remove dirfsp arg from struct files_struct
+ * Version 44 - Remove dirfsp arg to SMB_VFS_CREATE_FILE()
  */
 
 #define SMB_VFS_INTERFACE_VERSION 44
@@ -774,7 +775,6 @@ struct vfs_fn_pointers {
                         mode_t mode);
        NTSTATUS (*create_file_fn)(struct vfs_handle_struct *handle,
                                   struct smb_request *req,
-                                  struct files_struct **dirfsp,
                                   struct smb_filename *smb_fname,
                                   uint32_t access_mask,
                                   uint32_t share_access,
@@ -1289,7 +1289,6 @@ int smb_vfs_call_openat(struct vfs_handle_struct *handle,
                        mode_t mode);
 NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
                                  struct smb_request *req,
-                                 struct files_struct **dirfsp,
                                  struct smb_filename *smb_fname,
                                  uint32_t access_mask,
                                  uint32_t share_access,
@@ -1750,7 +1749,6 @@ int vfs_not_implemented_openat(vfs_handle_struct *handle,
                               mode_t mode);
 NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle,
                                struct smb_request *req,
-                               struct files_struct **dirfsp,
                                struct smb_filename *smb_fname,
                                uint32_t access_mask,
                                uint32_t share_access,
index e0a8d39194546ba3a884e771d2f247dba6a311c1..70d9ab6784cab6d95c92b7a9e3b98c4afe12f104 100644 (file)
 #define SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, flags, mode) \
        smb_vfs_call_openat((handle)->next, (dirfsp), (smb_fname), (fsp), (flags), (mode))
 
-#define SMB_VFS_CREATE_FILE(conn, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, \
+#define SMB_VFS_CREATE_FILE(conn, req, smb_fname, access_mask, share_access, create_disposition, \
         create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
-        smb_vfs_call_create_file((conn)->vfs_handles, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \
+        smb_vfs_call_create_file((conn)->vfs_handles, (req), (smb_fname), (access_mask), (share_access), (create_disposition), \
         (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
        (in_context_blobs), (out_context_blobs))
-#define SMB_VFS_NEXT_CREATE_FILE(handle, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, \
+#define SMB_VFS_NEXT_CREATE_FILE(handle, req, smb_fname, access_mask, share_access, create_disposition, \
        create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
-       smb_vfs_call_create_file((handle)->next, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \
+       smb_vfs_call_create_file((handle)->next, (req), (smb_fname), (access_mask), (share_access), (create_disposition), \
         (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
        (in_context_blobs), (out_context_blobs))
 
index 42b2e808d66743a92b7c0028b88e65e4d09012a4..d701465e3d15e181862a7e60f6e32929f3c79acb 100644 (file)
@@ -1109,7 +1109,6 @@ static bool ad_convert_xattr(vfs_handle_struct *handle,
                status = SMB_VFS_CREATE_FILE(
                        handle->conn,                   /* conn */
                        NULL,                           /* req */
-                       &handle->conn->cwd_fsp,         /* dirfsp */
                        stream_name,                    /* fname */
                        FILE_GENERIC_WRITE,             /* access_mask */
                        FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
@@ -1239,7 +1238,6 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                   /* conn */
                NULL,                           /* req */
-               &handle->conn->cwd_fsp,         /* dirfsp */
                stream_name,                    /* fname */
                FILE_GENERIC_WRITE,             /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
@@ -1470,7 +1468,6 @@ static bool ad_unconvert_open_ad(TALLOC_CTX *mem_ctx,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,
                NULL,                           /* req */
-               &handle->conn->cwd_fsp,         /* dirfsp */
                adpath,
                FILE_READ_DATA|FILE_WRITE_DATA,
                FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
@@ -1522,7 +1519,6 @@ static bool ad_unconvert_get_streams(struct vfs_handle_struct *handle,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                           /* conn */
                NULL,                                   /* req */
-               &handle->conn->cwd_fsp,                 /* dirfsp */
                smb_fname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -1622,7 +1618,6 @@ static bool ad_collect_one_stream(struct vfs_handle_struct *handle,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,
                NULL,                           /* req */
-               &handle->conn->cwd_fsp,         /* dirfsp */
                sname,
                FILE_READ_DATA|DELETE_ACCESS,
                FILE_SHARE_READ,
@@ -2084,7 +2079,6 @@ static int ad_open_rsrc(vfs_handle_struct *handle,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                   /* conn */
                NULL,                           /* req */
-               &handle->conn->cwd_fsp,         /* dirfsp */
                adp_smb_fname,
                access_mask,
                share_access,
index d42706a0fff41cff4f680662f81980f59a96c864..49e92ffea5510d631b315d7280fb20e2b092003d 100644 (file)
@@ -710,7 +710,6 @@ out:
 }
 static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
                                    struct smb_request *req,
-                                   struct files_struct **dirfsp,
                                    struct smb_filename *smb_fname,
                                    uint32_t access_mask,
                                    uint32_t share_access,
@@ -728,7 +727,7 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
                                    const struct smb2_create_blobs *in_context_blobs,
                                    struct smb2_create_blobs *out_context_blobs)
 {
-       return create_file_default(handle->conn, req, dirfsp, smb_fname,
+       return create_file_default(handle->conn, req, smb_fname,
                                   access_mask, share_access,
                                   create_disposition, create_options,
                                   file_attributes, oplock_request, lease,
index 90eaea4d9117c9e19dde4ad33a4d0d6d2aa044e4..8a843407596ce1e0a538410b35d727fc67cd1af3 100644 (file)
@@ -898,7 +898,6 @@ static bool readdir_attr_meta_finderi_stream(
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                           /* conn */
                NULL,                                   /* req */
-               &handle->conn->cwd_fsp,                 /* dirfsp */
                stream_name,                            /* fname */
                FILE_READ_DATA,                         /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -3912,7 +3911,6 @@ static int fruit_ftruncate(struct vfs_handle_struct *handle,
 
 static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
                                  struct smb_request *req,
-                                 struct files_struct **dirfsp,
                                  struct smb_filename *smb_fname,
                                  uint32_t access_mask,
                                  uint32_t share_access,
@@ -3967,7 +3965,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
        }
 
        status = SMB_VFS_NEXT_CREATE_FILE(
-               handle, req, dirfsp, smb_fname,
+               handle, req, smb_fname,
                access_mask, share_access,
                create_disposition, create_options,
                file_attributes, oplock_request,
@@ -4732,7 +4730,6 @@ static bool fruit_get_bandsize(vfs_handle_struct *handle,
        status = SMB_VFS_NEXT_CREATE_FILE(
                handle,                         /* conn */
                NULL,                           /* req */
-               &handle->conn->cwd_fsp,         /* dirfsp */
                smb_fname,                      /* fname */
                FILE_GENERIC_READ,              /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
index 82f60f8a68b263d8dbf1408fd010657c8b0262e7..5fceac6cf1fd59904d27bbe08d3e54342a1d3d90 100644 (file)
@@ -1099,7 +1099,6 @@ static int smb_full_audit_openat(vfs_handle_struct *handle,
 
 static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
                                      struct smb_request *req,
-                                     struct files_struct **dirfsp,
                                      struct smb_filename *smb_fname,
                                      uint32_t access_mask,
                                      uint32_t share_access,
@@ -1146,7 +1145,6 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
        result = SMB_VFS_NEXT_CREATE_FILE(
                handle,                                 /* handle */
                req,                                    /* req */
-               dirfsp,
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_access,                           /* share_access */
index 202c711ff92f4af3196653b05f4eca1cb65769e9..e3ce2804b5f41bc767f694e0740a6af254e4fb40 100644 (file)
@@ -1106,7 +1106,6 @@ out:
  */
 static NTSTATUS mh_create_file(vfs_handle_struct *handle,
                struct smb_request *req,
-               struct files_struct **dirfsp,
                struct smb_filename *smb_fname,
                uint32_t access_mask,
                uint32_t share_access,
@@ -1136,7 +1135,6 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
                status = SMB_VFS_NEXT_CREATE_FILE(
                        handle,
                        req,
-                       dirfsp,
                        smb_fname,
                        access_mask,
                        share_access,
@@ -1175,7 +1173,6 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
        status = SMB_VFS_NEXT_CREATE_FILE(
                handle,
                req,
-               dirfsp,
                clientFname,
                access_mask,
                share_access,
index 529ad579f495905a5940c8be951d7b847dc8e411..9b5b0f6b4f65f27f237d6eadac097095b829de81 100644 (file)
@@ -201,7 +201,6 @@ int vfs_not_implemented_openat(vfs_handle_struct *handle,
 
 NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle,
                                struct smb_request *req,
-                               struct files_struct **dirsp,
                                struct smb_filename *smb_fname,
                                uint32_t access_mask,
                                uint32_t share_access,
index f70ff73fec17ae232f44da89d900d3bc142b124e..c6b0130bb93889fab5fa7ec97b7018690da20454 100644 (file)
@@ -614,7 +614,6 @@ static int smb_time_audit_openat(vfs_handle_struct *handle,
 
 static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle,
                                           struct smb_request *req,
-                                          struct files_struct **dirfsp,
                                           struct smb_filename *fname,
                                           uint32_t access_mask,
                                           uint32_t share_access,
@@ -640,7 +639,6 @@ static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle,
        result = SMB_VFS_NEXT_CREATE_FILE(
                handle,                                 /* handle */
                req,                                    /* req */
-               dirfsp,                                 /* dirfsp */
                fname,                                  /* fname */
                access_mask,                            /* access_mask */
                share_access,                           /* share_access */
index c42acaef3fe3a7e6cc39e7b4958e86bb3a43edf1..ca20dc6baeb6f2bd5d5e0793aca0b8bec68aaee4 100644 (file)
@@ -838,7 +838,6 @@ err:
 
 static NTSTATUS um_create_file(vfs_handle_struct *handle,
                               struct smb_request *req,
-                              struct files_struct **dirfsp,
                               struct smb_filename *smb_fname,
                               uint32_t access_mask,
                               uint32_t share_access,
@@ -866,7 +865,6 @@ static NTSTATUS um_create_file(vfs_handle_struct *handle,
                return SMB_VFS_NEXT_CREATE_FILE(
                        handle,
                        req,
-                       dirfsp,
                        smb_fname,
                        access_mask,
                        share_access,
@@ -901,7 +899,6 @@ static NTSTATUS um_create_file(vfs_handle_struct *handle,
        status = SMB_VFS_NEXT_CREATE_FILE(
                handle,
                req,
-               dirfsp,
                client_fname,
                access_mask,
                share_access,
index 85232bd101eaafb2652eab95e5390b009b26bb3c..3ae1f9f39e682e7c08cb910727840b2ea1afd1e1 100644 (file)
@@ -24,7 +24,6 @@
 
 static NTSTATUS vfs_worm_create_file(vfs_handle_struct *handle,
                                     struct smb_request *req,
-                                    struct files_struct **dirfsp,
                                     struct smb_filename *smb_fname,
                                     uint32_t access_mask,
                                     uint32_t share_access,
@@ -63,7 +62,7 @@ static NTSTATUS vfs_worm_create_file(vfs_handle_struct *handle,
        }
 
        status = SMB_VFS_NEXT_CREATE_FILE(
-               handle, req, dirfsp, smb_fname, access_mask,
+               handle, req, smb_fname, access_mask,
                share_access, create_disposition, create_options,
                file_attributes, oplock_request, lease, allocation_size,
                private_flags, sd, ea_list, result, pinfo,
index e57ff3404deb0c6c2ffe7399f6044bdeebcdaeaf..fc4e552e213ef6ceac7a1fdcf0084a595e1de55d 100644 (file)
@@ -844,7 +844,6 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -899,7 +898,6 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -1103,7 +1101,6 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
index 2f18127b03b8ca88bd3dda15bbb0b5a25024d734..c0c67c792e2e42d9da6f278e62e940251a783cde 100644 (file)
@@ -2429,7 +2429,6 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                FILE_SHARE_READ|FILE_SHARE_WRITE,       /* share_access */
@@ -2564,7 +2563,6 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                FILE_WRITE_ATTRIBUTES,                  /* access_mask */
                FILE_SHARE_READ|FILE_SHARE_WRITE,       /* share_access */
index 8eef16404e0f55c6ac81e79a6c8a31c0b26713ef..18e46e86529d3c3ecab82f5c2e1105b607aa6fad 100644 (file)
@@ -1396,7 +1396,6 @@ static NTSTATUS get_file_handle_for_metadata(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname_cp,                           /* fname */
                FILE_WRITE_ATTRIBUTES,                  /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
index bc3cb82c889ac6eb0ab9b61026e93466199e4381..9f5737b83c0f65e1785dae3b1d41d0c061cc2fbe 100644 (file)
@@ -655,7 +655,6 @@ void reply_ntcreate_and_X(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_access,                           /* share_access */
@@ -1337,7 +1336,6 @@ static void call_nt_transact_create(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_access,                           /* share_access */
@@ -1596,7 +1594,6 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname_src,                          /* fname */
                FILE_READ_DATA|FILE_READ_ATTRIBUTES|
                        FILE_READ_EA,                   /* access_mask */
@@ -1622,7 +1619,6 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname_dst,                          /* fname */
                FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|
                        FILE_WRITE_EA,                  /* access_mask */
index 0686081b99303f1fbd38bfa81edae91822c838a1..e55e45903366c10470b8921b14aa4ca767df2dca 100644 (file)
@@ -4661,7 +4661,6 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_dname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                FILE_SHARE_NONE,                        /* share_access */
@@ -4854,7 +4853,6 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
                status = SMB_VFS_CREATE_FILE(
                         conn,                  /* conn */
                         NULL,                  /* req */
-                        &conn->cwd_fsp,        /* dirfsp */
                         smb_fname_cp,          /* fname */
                         DELETE_ACCESS,         /* access_mask */
                         (FILE_SHARE_READ |     /* share_access */
@@ -5875,7 +5873,6 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
 
 NTSTATUS create_file_default(connection_struct *conn,
                             struct smb_request *req,
-                            struct files_struct **_dirfsp,
                             struct smb_filename *smb_fname,
                             uint32_t access_mask,
                             uint32_t share_access,
index 8c36f9ec01f975054d623793899a463ef8607326..66a5bd87902bb0ed3d0ead02e511bd9d321b2f95 100644 (file)
@@ -749,7 +749,6 @@ struct fsp_lease *find_fsp_lease(struct files_struct *new_fsp,
                                 uint16_t lease_epoch);
 NTSTATUS create_file_default(connection_struct *conn,
                             struct smb_request *req,
-                            struct files_struct **dirfsp,
                             struct smb_filename * smb_fname,
                             uint32_t access_mask,
                             uint32_t share_access,
index a3c992beee2bc7ad4216aa7d2319fc449df57c28..4fd60c1a9d1ffe2352afc3333510c4dfd787532c 100644 (file)
@@ -1842,7 +1842,6 @@ void reply_search(struct smb_request *req)
                nt_status = SMB_VFS_CREATE_FILE(
                                conn, /* conn */
                                req, /* req */
-                               &conn->cwd_fsp, /* dirfsp */
                                smb_dname, /* dname */
                                FILE_LIST_DIRECTORY, /* access_mask */
                                FILE_SHARE_READ|
@@ -2220,7 +2219,6 @@ void reply_open(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -2410,7 +2408,6 @@ void reply_open_and_X(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -2841,7 +2838,6 @@ void reply_mknew(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -2977,7 +2973,6 @@ void reply_ctemp(struct smb_request *req)
                status = SMB_VFS_CREATE_FILE(
                        conn,                                   /* conn */
                        req,                                    /* req */
-                       &conn->cwd_fsp,                         /* dirfsp */
                        smb_fname,                              /* fname */
                        FILE_GENERIC_READ | FILE_GENERIC_WRITE, /* access_mask */
                        FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -3222,7 +3217,6 @@ static NTSTATUS do_unlink(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE
                (conn,                  /* conn */
                 req,                   /* req */
-                &conn->cwd_fsp,        /* dirfsp */
                 smb_fname,             /* fname */
                 DELETE_ACCESS,         /* access_mask */
                 FILE_SHARE_NONE,       /* share_access */
@@ -7161,7 +7155,6 @@ void reply_rmdir(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_dname,                              /* fname */
                DELETE_ACCESS,                          /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -8013,7 +8006,6 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
                status = SMB_VFS_CREATE_FILE(
                        conn,                           /* conn */
                        req,                            /* req */
-                       &conn->cwd_fsp,                 /* dirfsp */
                        smb_fname_src,                  /* fname */
                        access_mask,                    /* access_mask */
                        (FILE_SHARE_READ |              /* share_access */
@@ -8180,7 +8172,6 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
                status = SMB_VFS_CREATE_FILE(
                        conn,                           /* conn */
                        req,                            /* req */
-                       &conn->cwd_fsp,                 /* dirfsp */
                        smb_fname_src,                  /* fname */
                        access_mask,                    /* access_mask */
                        (FILE_SHARE_READ |              /* share_access */
@@ -8483,7 +8474,6 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname_src,                          /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -8514,7 +8504,6 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname_dst,                          /* fname */
                FILE_GENERIC_WRITE,                     /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
index c082b806743b7e6b485a0429042d135ea508771a..dbbf00dd90530e4b1ab49f7a7ffbab193df60687 100644 (file)
@@ -988,7 +988,6 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
 
        status = SMB_VFS_CREATE_FILE(smb1req->conn,
                                     smb1req,
-                                    &smb1req->conn->cwd_fsp,
                                     smb_fname,
                                     in_desired_access,
                                     in_share_access,
index 40c2559861f7fd86f754aa0144dc79c36e1ea1d9..14c788e6c0b4b00b65a8c196789f5585e4863eb9 100644 (file)
@@ -167,7 +167,6 @@ static NTSTATUS get_posix_fsp(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,           /* conn */
                req,            /* req */
-               &conn->cwd_fsp,  /* dirfsp */
                smb_fname_tmp,  /* fname */
                access_mask,    /* access_mask */
                share_access,   /* share_access */
@@ -1437,7 +1436,6 @@ static void call_trans2open(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -2974,7 +2972,6 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
        ntstatus = SMB_VFS_CREATE_FILE(
                        conn, /* conn */
                        req, /* req */
-                       &conn->cwd_fsp, /* dirfsp */
                        smb_dname, /* dname */
                        FILE_LIST_DIRECTORY, /* access_mask */
                        FILE_SHARE_READ|
@@ -6736,7 +6733,6 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname_tmp,                          /* fname */
                FILE_WRITE_DATA,                        /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -8001,7 +7997,6 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                FILE_WRITE_DATA,                        /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -8515,7 +8510,6 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                FILE_SHARE_NONE,                        /* share_access */
@@ -8757,7 +8751,6 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -8900,7 +8893,6 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
-               &conn->cwd_fsp,                         /* dirfsp */
                smb_fname,                              /* fname */
                DELETE_ACCESS,                          /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
index 9ba104903f8c4849b65b392a66f0d50a47a8cfc5..515b8c079b483b6f655d4975be1d2cf2a23998b5 100644 (file)
@@ -1807,7 +1807,6 @@ int smb_vfs_call_openat(struct vfs_handle_struct *handle,
 
 NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
                                  struct smb_request *req,
-                                 struct files_struct **dirfsp,
                                  struct smb_filename *smb_fname,
                                  uint32_t access_mask,
                                  uint32_t share_access,
@@ -1827,7 +1826,7 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
 {
        VFS_FIND(create_file);
        return handle->fns->create_file_fn(
-               handle, req, dirfsp, smb_fname,
+               handle, req, smb_fname,
                access_mask, share_access, create_disposition, create_options,
                file_attributes, oplock_request, lease, allocation_size,
                private_flags, sd, ea_list,
index ddd9514893fe3578b9e28d17d8f4148fde31532f..59e9c60b3a6109795d18b8e32c37e3033cf26f17 100644 (file)
@@ -244,7 +244,6 @@ static int net_vfs_get_ntacl(struct net_context *net,
        status = SMB_VFS_CREATE_FILE(
                state.conn_tos->conn,
                NULL,                           /* req */
-               &state.conn_tos->conn->cwd_fsp,
                smb_fname,
                FILE_READ_ATTRIBUTES|READ_CONTROL_ACCESS,
                FILE_SHARE_READ|FILE_SHARE_WRITE,