[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Oct 2 21:01:05 UTC 2020


The branch, master has been updated
       via  322574834f1 vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()
       via  1c444f9c37c smbd: remove fsp->dirfsp
       via  b133b81d8d1 smbd: avoid using dirfsp arg in create_file_default()
       via  a366b756a1e vfs_fruit: avoid using fsp->dirsp
       via  9d84a2356b1 smbd: remove dirfsp arg from create_file_unixpath()
       via  a7544661816 smbd: remove dirsp arg from open_directory()
       via  7ccaff48575 smbd: remove dirfsp arg from mkdir_internal()
       via  d196cf46042 vfs_fruit: use VFS ftruncate function in fruit_ftruncate_rsrc_adouble()
       via  187353d91cb smbd: switch caller of fd_openat() to fd_open()
       via  4389ae9ca0c vfs_fruit: ensure the buffer passed to file_lines_parse() is 0-terminated
       via  616b64c3627 s4/torture: use unique filename for torture_samba3_hide() test
       via  176290eb68f vfs_default: realign vfswrap_fgetxattr() args
       via  089d8f44381 vfs: add and use vfs_fake_fd()
       via  80ac7fa7c4c build: remove smbd_conn private library
      from  a3cd3153212 python2 reduction: Merge remaining compat code into common

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 322574834f1e71bc01f21be9059ca4d386517c84
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 2 17:29:58 2020 +0200

    vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()
    
    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 at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Oct  2 21:00:05 UTC 2020 on sn-devel-184

commit 1c444f9c37c01f986cbe880f0a6d4abdd8c34a0b
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 2 16:51:16 2020 +0200

    smbd: remove fsp->dirfsp
    
    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 at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b133b81d8d18b998ee8e01ef034732c36169bf98
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 2 17:25:33 2020 +0200

    smbd: avoid using dirfsp arg in create_file_default()
    
    This is not used anymore in the callees.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit a366b756a1e0118295eb94b7393e3f476f39862c
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Jun 22 15:04:18 2020 +0200

    vfs_fruit: avoid using fsp->dirsp
    
    fsp->dirfsp will eventually go away again.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9d84a2356b1000b222f303e8cfd20badc998c8fb
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 2 16:41:27 2020 +0200

    smbd: remove dirfsp arg from create_file_unixpath()
    
    Prepares for removing the dirfsp arg from SMB_VFS_CREATE_FILE() again. In the
    future dirfsp has to opened as needed within create_file_unixpath() and below.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit a7544661816a3d06cdc67e1e08a9afca81d7cf9b
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 2 16:30:03 2020 +0200

    smbd: remove dirsp arg from open_directory()
    
    Prepares for removing the dirfsp arg from SMB_VFS_CREATE_FILE() again. In the
    future open_directory() will open the dirfsp itself.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7ccaff48575b1a94a778f43409505f149b6bdcb8
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jun 23 14:10:21 2020 +0200

    smbd: remove dirfsp arg from mkdir_internal()
    
    Prepares for removing the dirfsp arg from SMB_VFS_CREATE_FILE() again. In the
    future mkdir_internal() will open the dirfsp itself as needed.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d196cf4604208b158a6872ece20be6014a0198f9
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Sep 29 11:15:10 2020 +0200

    vfs_fruit: use VFS ftruncate function in fruit_ftruncate_rsrc_adouble()
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 187353d91cb9ffe441b84dccb4a8a5a5ce6281af
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Sep 30 16:26:29 2020 +0200

    smbd: switch caller of fd_openat() to fd_open()
    
    fd_openat() was added to be used with real dirfsp, but after adding pathref fd
    support we will never use this.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 4389ae9ca0ceed6c56d315c57ac1e8590ab7f699
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Aug 6 12:55:33 2020 +0200

    vfs_fruit: ensure the buffer passed to file_lines_parse() is 0-terminated
    
    Otherwise valgrind complains...
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 616b64c3627bfee4f4f8541c0b5e6a675c24a643
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Sep 16 15:40:36 2020 +0200

    s4/torture: use unique filename for torture_samba3_hide() test
    
    The filename "test.txt" is also used by other tests and without O_PATH the file
    can't be removed at the end of this tests: open_smb_fname_fsp() fails with
    ACCESS_DENIED because the POSIX mode of the file is 0000 and become_root() used
    in the #ifndef O_PATH fallback case doesn't work in CI.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 176290eb68f57f953821b33130f595d2cdb79089
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Jun 10 16:01:18 2020 +0200

    vfs_default: realign vfswrap_fgetxattr() args
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 089d8f443814af1620982d6834fba74e03933ad1
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Jul 23 07:32:11 2020 +0200

    vfs: add and use vfs_fake_fd()
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 80ac7fa7c4c728bef4f947872c090fec35fb26f0
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Sep 27 08:52:58 2020 +0200

    build: remove smbd_conn private library
    
    This is not needed anymore since 6822baa2920f30374ec84363497d97e24f359fab.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/VFS/skel_opaque.c                |   1 -
 examples/VFS/skel_transparent.c           |   2 -
 source3/include/vfs.h                     |   9 +--
 source3/include/vfs_macros.h              |   8 +-
 source3/lib/adouble.c                     |   6 --
 source3/lib/filename_util.c               |  20 -----
 source3/modules/vfs_default.c             |   9 ++-
 source3/modules/vfs_fruit.c               |  38 ++--------
 source3/modules/vfs_full_audit.c          |   2 -
 source3/modules/vfs_media_harmony.c       |   3 -
 source3/modules/vfs_not_implemented.c     |   1 -
 source3/modules/vfs_streams_xattr.c       |  14 +---
 source3/modules/vfs_time_audit.c          |   2 -
 source3/modules/vfs_unityed_media.c       |   3 -
 source3/modules/vfs_worm.c                |   3 +-
 source3/printing/nt_printing.c            |   3 -
 source3/rpc_server/srvsvc/srv_srvsvc_nt.c |   2 -
 source3/smbd/close.c                      |  12 ---
 source3/smbd/dosmode.c                    |   1 -
 source3/smbd/durable.c                    |   5 +-
 source3/smbd/nttrans.c                    |   4 -
 source3/smbd/open.c                       | 119 ++++--------------------------
 source3/smbd/proto.h                      |   5 +-
 source3/smbd/reply.c                      |  11 ---
 source3/smbd/smb2_create.c                |   1 -
 source3/smbd/trans2.c                     |   8 --
 source3/smbd/vfs.c                        |  21 +++++-
 source3/utils/net_vfs.c                   |   1 -
 source3/wscript_build                     |   7 +-
 source4/torture/raw/samba3hide.c          |   2 +-
 30 files changed, 61 insertions(+), 262 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 0a6ca4d9200..90ee82ab258 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -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,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 677af2217bf..d48ac47443b 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -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,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index d527f850628..b282e2a361b 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -327,9 +327,12 @@
  * Version 43 - SMB_VFS_READ_DFS_PATHAT() should take a non-const name.
 		There's no easy way to return stat info for a DFS link
 		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 43
+#define SMB_VFS_INTERFACE_VERSION 44
 
 /*
     All intercepted VFS operations must be declared as static functions inside module source
@@ -384,7 +387,6 @@ typedef struct files_struct {
 	struct smbXsrv_open *op;
 	struct connection_struct *conn;
 	struct fd_handle *fh;
-	struct files_struct *dirfsp;
 	unsigned int num_smb_operations;
 	struct file_id file_id;
 	uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */
@@ -773,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,
@@ -1288,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,
@@ -1749,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,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index e0a8d391945..70d9ab6784c 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -147,14 +147,14 @@
 #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))
 
diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c
index 42b2e808d66..d701465e3d1 100644
--- a/source3/lib/adouble.c
+++ b/source3/lib/adouble.c
@@ -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,
diff --git a/source3/lib/filename_util.c b/source3/lib/filename_util.c
index 84a248eb766..fb79dab09bd 100644
--- a/source3/lib/filename_util.c
+++ b/source3/lib/filename_util.c
@@ -187,26 +187,6 @@ const char *fsp_str_dbg(const struct files_struct *fsp)
 		return "";
 	}
 
-	if (fsp->dirfsp == NULL || fsp->dirfsp == fsp->conn->cwd_fsp) {
-		return name;
-	}
-
-	if (ISDOT(fsp->dirfsp->fsp_name->base_name)) {
-		return name;
-	}
-
-	name = smb_fname_str_dbg(fsp->fsp_name);
-	if (name == NULL) {
-		return "";
-	}
-
-	name = talloc_asprintf(talloc_tos(),
-			       "%s/%s",
-			       fsp->dirfsp->fsp_name->base_name,
-			       name);
-	if (name == NULL) {
-		return "";
-	}
 	return name;
 }
 
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 30f568c5e80..49e92ffea55 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -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,
@@ -3556,7 +3555,11 @@ static ssize_t vfswrap_getxattrat_recv(struct tevent_req *req,
 	return xattr_size;
 }
 
-static ssize_t vfswrap_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
+static ssize_t vfswrap_fgetxattr(struct vfs_handle_struct *handle,
+				 struct files_struct *fsp,
+				 const char *name,
+				 void *value,
+				 size_t size)
 {
 	return fgetxattr(fsp->fh->fd, name, value, size);
 }
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 51251b7b86b..8a843407596 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -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 */
@@ -1312,27 +1311,6 @@ static int fruit_connect(vfs_handle_struct *handle,
 	return rc;
 }
 
-static int fruit_fake_fd(void)
-{
-	int pipe_fds[2];
-	int fd;
-	int ret;
-
-	/*
-	 * Return a valid fd, but ensure any attempt to use it returns
-	 * an error (EPIPE). Once we get a write on the handle, we open
-	 * the real fd.
-	 */
-	ret = pipe(pipe_fds);
-	if (ret != 0) {
-		return -1;
-	}
-	fd = pipe_fds[0];
-	close(pipe_fds[1]);
-
-	return fd;
-}
-
 static int fruit_open_meta_stream(vfs_handle_struct *handle,
 				  const struct files_struct *dirfsp,
 				  const struct smb_filename *smb_fname,
@@ -1369,7 +1347,7 @@ static int fruit_open_meta_stream(vfs_handle_struct *handle,
 		return -1;
 	}
 
-	fd = fruit_fake_fd();
+	fd = vfs_fake_fd();
 	if (fd == -1) {
 		VFS_REMOVE_FSP_EXTENSION(handle, fsp);
 		return -1;
@@ -1409,7 +1387,7 @@ static int fruit_open_meta_netatalk(vfs_handle_struct *handle,
 		return -1;
 	}
 
-	fd = fruit_fake_fd();
+	fd = vfs_fake_fd();
 	if (fd == -1) {
 		return -1;
 	}
@@ -2489,7 +2467,7 @@ static ssize_t fruit_pwrite_meta_stream(vfs_handle_struct *handle,
 		}
 
 		fd = SMB_VFS_NEXT_OPENAT(handle,
-					 fsp->dirfsp,
+					 fsp->conn->cwd_fsp,
 					 fsp->fsp_name,
 					 fsp,
 					 fio->flags,
@@ -3828,7 +3806,7 @@ static int fruit_ftruncate_rsrc_adouble(struct vfs_handle_struct *handle,
 
 	ad_off = ad_getentryoff(ad, ADEID_RFORK);
 
-	rc = ftruncate(fsp->fh->fd, offset + ad_off);
+	rc = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset + ad_off);
 	if (rc != 0) {
 		TALLOC_FREE(ad);
 		return -1;
@@ -3933,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,
@@ -3988,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,
@@ -4753,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 */
@@ -4776,7 +4752,9 @@ static bool fruit_get_bandsize(vfs_handle_struct *handle,
 		goto out;
 	}
 
-	file_data = talloc_array(talloc_tos(), uint8_t, plist_file_size);
+	file_data = talloc_zero_array(talloc_tos(),
+				      uint8_t,
+				      plist_file_size + 1);
 	if (file_data == NULL) {
 		ok = false;
 		goto out;
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 82f60f8a68b..5fceac6cf1f 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -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 */
diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c
index 202c711ff92..e3ce2804b5f 100644
--- a/source3/modules/vfs_media_harmony.c
+++ b/source3/modules/vfs_media_harmony.c
@@ -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,
diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c
index 529ad579f49..9b5b0f6b4f6 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -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,
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 2e4105fec49..13ea46b0806 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -371,7 +371,6 @@ static int streams_xattr_openat(struct vfs_handle_struct *handle,
 	struct stream_io *sio = NULL;
 	struct ea_struct ea;
 	char *xattr_name = NULL;
-	int pipe_fds[2];
 	int fakefd = -1;
 	bool set_empty_xattr = false;
 	int ret;
@@ -456,18 +455,7 @@ static int streams_xattr_openat(struct vfs_handle_struct *handle,
 		}
 	}
 
-	/*
-	 * Return a valid fd, but ensure any attempt to use it returns an error
-	 * (EPIPE).
-	 */
-	ret = pipe(pipe_fds);
-	if (ret != 0) {
-		goto fail;
-	}
-
-	close(pipe_fds[1]);
-	pipe_fds[1] = -1;
-	fakefd = pipe_fds[0];
+	fakefd = vfs_fake_fd();
 
         sio = VFS_ADD_FSP_EXTENSION(handle, fsp, struct stream_io, NULL);
         if (sio == NULL) {
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index f70ff73fec1..c6b0130bb93 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -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 */
diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c
index c42acaef3fe..ca20dc6baeb 100644
--- a/source3/modules/vfs_unityed_media.c
+++ b/source3/modules/vfs_unityed_media.c
@@ -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,
diff --git a/source3/modules/vfs_worm.c b/source3/modules/vfs_worm.c
index 85232bd101e..3ae1f9f39e6 100644
--- a/source3/modules/vfs_worm.c
+++ b/source3/modules/vfs_worm.c
@@ -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,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index e57ff3404de..fc4e552e213 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -844,7 +844,6 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr


-- 
Samba Shared Repository



More information about the samba-cvs mailing list