Revert "vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()"
authorVolker Lendecke <vl@samba.org>
Tue, 23 Nov 2021 11:29:17 +0000 (12:29 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 28 Apr 2022 13:12:33 +0000 (13:12 +0000)
This reverts commit 322574834f1e71bc01f21be9059ca4d386517c84.

Not strictly a revert anymore, but for future work we do need "dirfsp"
in create_file_default() passed through the VFS.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
27 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/open.c
source3/smbd/proto.h
source3/smbd/smb1_nttrans.c
source3/smbd/smb1_reply.c
source3/smbd/smb1_trans2.c
source3/smbd/smb2_create.c
source3/smbd/smb2_nttrans.c
source3/smbd/smb2_reply.c
source3/smbd/smb2_trans2.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c
source3/utils/net_vfs.c

index 3c511ead769b4ecf7b11552a5dcde6cb13f15bd6..23614b660d92f33b736f27df04ecbe47d83e471e 100644 (file)
@@ -206,6 +206,7 @@ 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 43d5e81837819e7213b408ecc7278624dddbe3e8..9fc211c5e2ee1acec700784adb5fc7ac8658de8c 100644 (file)
@@ -214,6 +214,7 @@ 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,
@@ -232,6 +233,7 @@ 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 316a6c0ec7360ef02876b31eb844b806fb1e9f2c..841a930d309fc35d7654906e253403e1f90632b0 100644 (file)
                from files_struct.
  * Version 47 - Add SMB_VFS_GET_REAL_FILENAME_AT
  * Version 47 - Replace SMB_VFS_GET_REAL_FILENAME with SMB_VFS_GET_REAL_FILENAME_AT
+ * Version 47 - Re-add dirfsp to CREATE_FILE
  */
 
 #define SMB_VFS_INTERFACE_VERSION 47
@@ -975,6 +976,7 @@ 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,
@@ -1460,6 +1462,7 @@ 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,
@@ -1904,6 +1907,7 @@ 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 43cfee814fd1d32c02cbff57cc3f852218a16bf3..840e77cf1b05c4a66d3915e4aa44277d6c26314a 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, smb_fname, access_mask, share_access, create_disposition, \
+#define SMB_VFS_CREATE_FILE(conn, req, dirfsp, 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), (smb_fname), (access_mask), (share_access), (create_disposition), \
+        smb_vfs_call_create_file((conn)->vfs_handles, (req), (dirfsp), (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, smb_fname, access_mask, share_access, create_disposition, \
+#define SMB_VFS_NEXT_CREATE_FILE(handle, req, dirfsp, 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), (smb_fname), (access_mask), (share_access), (create_disposition), \
+       smb_vfs_call_create_file((handle)->next, (req), (dirfsp), (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 ddc43fab0f4193860134d6588cf9417360c38488..b831464f5a96f096fc607a2b7a1eeb0e2e16538e 100644 (file)
@@ -1219,6 +1219,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle,
                status = SMB_VFS_CREATE_FILE(
                        handle->conn,                   /* conn */
                        NULL,                           /* req */
+                       NULL,                           /* dirfsp */
                        stream_name,                    /* fname */
                        FILE_GENERIC_WRITE,             /* access_mask */
                        FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
@@ -1355,6 +1356,7 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                   /* conn */
                NULL,                           /* req */
+               NULL,                           /* dirfsp */
                stream_name,                    /* fname */
                FILE_GENERIC_WRITE,             /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
@@ -1604,6 +1606,7 @@ static bool ad_unconvert_open_ad(TALLOC_CTX *mem_ctx,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,
                NULL,                           /* req */
+               NULL,                           /* dirfsp */
                adpath,
                FILE_READ_DATA|FILE_WRITE_DATA,
                FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
@@ -1660,6 +1663,7 @@ static bool ad_unconvert_get_streams(struct vfs_handle_struct *handle,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                           /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -1755,6 +1759,7 @@ static bool ad_collect_one_stream(struct vfs_handle_struct *handle,
        status = SMB_VFS_CREATE_FILE(
                handle->conn,
                NULL,                           /* req */
+               NULL,                           /* dirfsp */
                sname,
                FILE_READ_DATA|DELETE_ACCESS,
                FILE_SHARE_READ,
index 400bd98cacbecfbcf7ce048bb62b4c45db170b9b..d67a9fe43252d65242fbacaaca075ec31ea2a834 100644 (file)
@@ -735,6 +735,7 @@ 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,
@@ -752,7 +753,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, smb_fname,
+       return create_file_default(handle->conn, req, dirfsp, smb_fname,
                                   access_mask, share_access,
                                   create_disposition, create_options,
                                   file_attributes, oplock_request, lease,
index 81bc0cf4cc2c56809c93588a5ccc1dbe7e502843..183c4e02371c1e52a6cc253aefcfc917def7926a 100644 (file)
@@ -964,6 +964,7 @@ static bool readdir_attr_meta_finderi_stream(
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                           /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                stream_name,                            /* fname */
                FILE_READ_DATA,                         /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -4136,6 +4137,7 @@ 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,
@@ -4188,7 +4190,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
        }
 
        status = SMB_VFS_NEXT_CREATE_FILE(
-               handle, req, smb_fname,
+               handle, req, dirfsp, smb_fname,
                access_mask, share_access,
                create_disposition, create_options,
                file_attributes, oplock_request,
@@ -4957,6 +4959,7 @@ static bool fruit_get_bandsize(vfs_handle_struct *handle,
        status = SMB_VFS_NEXT_CREATE_FILE(
                handle,                         /* conn */
                NULL,                           /* req */
+               NULL,                           /* dirfsp */
                smb_fname,                      /* fname */
                FILE_GENERIC_READ,              /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
index dc013e7e3a176be9de92deb5ccfe14f512e0f13e..af37cf1933592ede0f5dd752b701ed5240dc0690 100644 (file)
@@ -1119,6 +1119,7 @@ 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,
@@ -1165,6 +1166,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
        result = SMB_VFS_NEXT_CREATE_FILE(
                handle,                                 /* handle */
                req,                                    /* req */
+               dirfsp,                                 /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_access,                           /* share_access */
index a26db2beebca12f9e4c76ce5842fb3ca5eee237a..38340daa3af46604885a7868b04142d16e516139 100644 (file)
@@ -1116,6 +1116,7 @@ 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,
@@ -1145,6 +1146,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
                status = SMB_VFS_NEXT_CREATE_FILE(
                        handle,
                        req,
+                       dirfsp,
                        smb_fname,
                        access_mask,
                        share_access,
@@ -1183,6 +1185,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
        status = SMB_VFS_NEXT_CREATE_FILE(
                handle,
                req,
+               dirfsp,
                clientFname,
                access_mask,
                share_access,
index 9c72e417f2618297f67a49cd9c7359a577081db5..3bfd86a96139ddd960052e44663f0854b3fa2e34 100644 (file)
@@ -226,6 +226,7 @@ int vfs_not_implemented_openat(vfs_handle_struct *handle,
 _PUBLIC_
 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 4f9ad52592f7891dc419033cad6d593377584235..481a9b0829f748cad6f5c057c40bdf8430b5d315 100644 (file)
@@ -647,6 +647,7 @@ 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,
@@ -672,6 +673,7 @@ 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 fbd4d968172adb12751b6206b1265ee88721ac2d..30200da9ae49164358d21a7561bf738b190d80cd 100644 (file)
@@ -851,6 +851,7 @@ 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,
@@ -878,6 +879,7 @@ static NTSTATUS um_create_file(vfs_handle_struct *handle,
                return SMB_VFS_NEXT_CREATE_FILE(
                        handle,
                        req,
+                       dirfsp,
                        smb_fname,
                        access_mask,
                        share_access,
@@ -912,6 +914,7 @@ 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 76762e0a84f766875c012921f1d84d0b00de8cf4..833a0ac26fe46b0b061e10e38b545ae5fe327785 100644 (file)
@@ -24,6 +24,7 @@
 
 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,
@@ -62,7 +63,7 @@ static NTSTATUS vfs_worm_create_file(vfs_handle_struct *handle,
        }
 
        status = SMB_VFS_NEXT_CREATE_FILE(
-               handle, req, smb_fname, access_mask,
+               handle, req, dirfsp, 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 c1d6458e36a29deaf1f37f9fc027f1b0202d3463..6961a4ddda970a849dbccfb09f20547e84d82b99 100644 (file)
@@ -830,6 +830,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -892,6 +893,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -1108,6 +1110,7 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
index ea296eaa6ab2f3545b5781b466977a387170da72..e863bdf3dabb2f92e5b377bd61bd257258c9118b 100644 (file)
@@ -2482,6 +2482,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                FILE_SHARE_READ|FILE_SHARE_WRITE,       /* share_access */
@@ -2619,6 +2620,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_WRITE_ATTRIBUTES,                  /* access_mask */
                FILE_SHARE_READ|FILE_SHARE_WRITE,       /* share_access */
index 056fa470b0daacb33752c3ede209d6c182889850..e5d559f6c6b6902d2fa72d70393b4f3b696eb2a8 100644 (file)
@@ -4765,6 +4765,7 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_dname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                FILE_SHARE_NONE,                        /* share_access */
@@ -5008,6 +5009,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
                status = SMB_VFS_CREATE_FILE(
                         conn,                  /* conn */
                         NULL,                  /* req */
+                        NULL,                  /* dirfsp */
                         smb_fname_cp,          /* fname */
                         DELETE_ACCESS,         /* access_mask */
                         (FILE_SHARE_READ |     /* share_access */
@@ -6150,6 +6152,7 @@ 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 890e577e46693487f32f28bcaf553876c5f61845..5d1b97e81af00870c56ed23eaf4d6e268acf096a 100644 (file)
@@ -743,6 +743,7 @@ 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 c370da4c935936094edfc809d529043f3f26de2d..39783c4b3a1c233ace56b8339b5db98cdc0d938b 100644 (file)
@@ -653,6 +653,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_access,                           /* share_access */
@@ -1186,6 +1187,7 @@ static void call_nt_transact_create(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_access,                           /* share_access */
index b99898fbad72a3fb339d7596f4eff6948bac5f3f..ec774e23ee3c748d3fe6c3e73a9874df1ed61149 100644 (file)
@@ -1087,6 +1087,7 @@ void reply_search(struct smb_request *req)
                nt_status = SMB_VFS_CREATE_FILE(
                                conn, /* conn */
                                req, /* req */
+                               NULL, /* dirfsp */
                                smb_dname, /* dname */
                                FILE_LIST_DIRECTORY, /* access_mask */
                                FILE_SHARE_READ|
@@ -1465,6 +1466,7 @@ void reply_open(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -1654,6 +1656,7 @@ void reply_open_and_X(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -2084,6 +2087,7 @@ void reply_mknew(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -2219,6 +2223,7 @@ void reply_ctemp(struct smb_request *req)
                status = SMB_VFS_CREATE_FILE(
                        conn,                                   /* conn */
                        req,                                    /* req */
+                       NULL,                                   /* dirfsp */
                        smb_fname,                              /* fname */
                        FILE_GENERIC_READ | FILE_GENERIC_WRITE, /* access_mask */
                        FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -5858,6 +5863,7 @@ void reply_rmdir(struct smb_request *req)
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_dname,                              /* fname */
                DELETE_ACCESS,                          /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
index 5edba32283996a9277545102b763e2b9b46f2d50..ea11788c783393e3d53a87cbd88fd0e07f0123a3 100644 (file)
@@ -660,6 +660,7 @@ static void call_trans2open(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                share_mode,                             /* share_access */
@@ -1018,6 +1019,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
        ntstatus = SMB_VFS_CREATE_FILE(
                        conn, /* conn */
                        req, /* req */
+                       NULL, /* dirfsp */
                        smb_dname, /* dname */
                        FILE_LIST_DIRECTORY, /* access_mask */
                        FILE_SHARE_READ|
@@ -2723,6 +2725,7 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_dname,                              /* fname */
                MAXIMUM_ALLOWED_ACCESS,                 /* access_mask */
                FILE_SHARE_NONE,                        /* share_access */
index 856bf9e50de71b3f5c79898072aebdec380280dc..275f539af7fe2d2b22d21eb613259d0cc8a9a943 100644 (file)
@@ -1015,6 +1015,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
 
        status = SMB_VFS_CREATE_FILE(smb1req->conn,
                                     smb1req,
+                                    NULL,
                                     smb_fname,
                                     in_desired_access,
                                     in_share_access,
index b8cb6424ca5f49a8b71b4a467b184bfd73144eca..a7e4c0f5c855b4d4e29a6e25266923836533b502 100644 (file)
@@ -246,6 +246,7 @@ NTSTATUS copy_internals(TALLOC_CTX *ctx,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname_src,                          /* fname */
                FILE_READ_DATA|FILE_READ_ATTRIBUTES|
                        FILE_READ_EA,                   /* access_mask */
@@ -271,6 +272,7 @@ NTSTATUS copy_internals(TALLOC_CTX *ctx,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname_dst,                          /* fname */
                FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|
                        FILE_WRITE_EA,                  /* access_mask */
index 3f8eb74c9f07f6aaafcff4fd6f75813c97599792..5f3c9be41eb8aad120992b5dc765d3e324acadd6 100644 (file)
@@ -844,6 +844,7 @@ NTSTATUS unlink_internals(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE
                (conn,                  /* conn */
                 req,                   /* req */
+                NULL,                  /* dirfsp */
                 smb_fname,             /* fname */
                 DELETE_ACCESS,         /* access_mask */
                 FILE_SHARE_NONE,       /* share_access */
@@ -1779,6 +1780,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
        status = SMB_VFS_CREATE_FILE(
                        conn,                           /* conn */
                        req,                            /* req */
+                       NULL,                           /* dirfsp */
                        smb_fname_src,                  /* fname */
                        access_mask,                    /* access_mask */
                        (FILE_SHARE_READ |              /* share_access */
@@ -1904,6 +1906,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname_src,                          /* fname */
                FILE_GENERIC_READ,                      /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
@@ -1941,6 +1944,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
+               NULL,                                   /* dirfsp */
                smb_fname_dst,                          /* fname */
                FILE_GENERIC_WRITE,                     /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE,     /* share_access */
index 65d8532468d7e37c36623c8781b091f2421b3bc4..ba54c5ada6e0cf08f6228662e8cc688003d9041f 100644 (file)
@@ -148,6 +148,7 @@ static NTSTATUS get_posix_fsp(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,           /* conn */
                req,            /* req */
+               NULL,           /* dirfsp */
                smb_fname,      /* fname */
                access_mask,    /* access_mask */
                share_access,   /* share_access */
@@ -4537,6 +4538,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_WRITE_DATA,                        /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -5640,6 +5642,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_WRITE_DATA,                        /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -6162,6 +6165,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                FILE_READ_ATTRIBUTES,                   /* access_mask */
                FILE_SHARE_NONE,                        /* share_access */
@@ -6403,6 +6407,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                access_mask,                            /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
@@ -6545,6 +6550,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
         status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                req,                                    /* req */
+               NULL,                                   /* dirfsp */
                smb_fname,                              /* fname */
                DELETE_ACCESS,                          /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
index 6ae68cdf87889c3470a557b59dd8711bf1300559..1f46e9a25293d2eb80766cf3bbb65b0b16f1fe53 100644 (file)
@@ -1688,6 +1688,7 @@ 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,
@@ -1707,7 +1708,7 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
 {
        VFS_FIND(create_file);
        return handle->fns->create_file_fn(
-               handle, req, smb_fname,
+               handle, req, dirfsp, smb_fname,
                access_mask, share_access, create_disposition, create_options,
                file_attributes, oplock_request, lease, allocation_size,
                private_flags, sd, ea_list,
index e0098442fbb769562473e317cadba686d4249efe..b27eca87ab49c816ba8a35626ae41769a0a11933 100644 (file)
@@ -2240,6 +2240,7 @@ static NTSTATUS cmd_create_file(
        status = SMB_VFS_CREATE_FILE(
                vfs->conn,
                NULL,
+               NULL,
 
                /*
                 * Using fname->fsp->fsp_name seems to be legal,
index 53e4583af398a7aab3df546b855a21f1a1debb1a..90822bf368c2983556054f39fd03f15df535fb9a 100644 (file)
@@ -252,6 +252,7 @@ static int net_vfs_get_ntacl(struct net_context *net,
        status = SMB_VFS_CREATE_FILE(
                state.conn_tos->conn,
                NULL,                           /* req */
+               NULL,
                smb_fname,
                FILE_READ_ATTRIBUTES|READ_CONTROL_ACCESS,
                FILE_SHARE_READ|FILE_SHARE_WRITE,