[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Fri Oct 25 11:51:02 UTC 2024


The branch, master has been updated
       via  2065f006560 smbd: convert fsp->posix_flags to fsp->fsp_flags.posix_open
       via  149f77b63ee smbd: remove seperate flag FSP_POSIX_FLAGS_PATHNAMES
       via  38b5c8c6632 smbd: remove "fruit:posix_rename"
      from  ce459ddbcd0 vfs_ceph_new: switch to ceph_readdir_r

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


- Log -----------------------------------------------------------------
commit 2065f006560ad6a7857e49ceb326bc70ce6d60b6
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 4 19:22:39 2024 +0200

    smbd: convert fsp->posix_flags to fsp->fsp_flags.posix_open
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Fri Oct 25 11:50:01 UTC 2024 on atb-devel-224

commit 149f77b63eed1ca31507ff9833a42d5e4fa3c00e
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 4 19:05:36 2024 +0200

    smbd: remove seperate flag FSP_POSIX_FLAGS_PATHNAMES
    
    Essentially FSP_POSIX_FLAGS_OPEN implies FSP_POSIX_FLAGS_PATHNAMES, so we can
    just remove FSP_POSIX_FLAGS_PATHNAMES and simplify things.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 38b5c8c6632324f6376ac582ddeedbae1ad9250c
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Oct 4 19:01:19 2024 +0200

    smbd: remove "fruit:posix_rename"
    
    This option of the vfs_fruit VFS module that could be used to enable POSIX
    directory rename behaviour for OS X clients has been removed as it could result
    in severe problems for Windows clients.
    
    As a possible workaround it is possible to prevent creation of .DS_Store files
    (a Finder thingy to store directory view settings) on network mounts by running
    
      $ defaults write com.apple.desktopservices DSDontWriteNetworkStores true
    
    on the Mac.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 WHATSNEW.txt                        |  16 ++++-
 docs-xml/manpages/vfs_fruit.8.xml   |  11 ---
 source3/include/vfs.h               |  20 ++----
 source3/locking/share_mode_lock.c   |   2 +-
 source3/modules/vfs_acl_common.c    |   2 +-
 source3/modules/vfs_fruit.c         |  13 ----
 source3/param/loadparm.c            |   2 +-
 source3/smbd/dir.c                  |   5 +-
 source3/smbd/dosmode.c              |   2 +-
 source3/smbd/fileio.c               |   4 +-
 source3/smbd/files.c                |   2 +-
 source3/smbd/open.c                 |   8 +--
 source3/smbd/smb1_trans2.c          |   2 +-
 source3/smbd/smb2_getinfo.c         |   2 +-
 source3/smbd/smb2_lock.c            |   2 +-
 source3/smbd/smb2_nttrans.c         |   2 +-
 source3/smbd/smb2_query_directory.c |   4 +-
 source3/smbd/smb2_reply.c           |  10 +--
 source3/smbd/smb2_trans2.c          |   6 +-
 source3/smbd/vfs.c                  |   2 +-
 source4/torture/vfs/fruit.c         | 132 ------------------------------------
 21 files changed, 46 insertions(+), 203 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index a8933e08ef0..c9db9360169 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -23,6 +23,20 @@ REMOVED FEATURES
 The "nmbd proxy logon" feature was removed. This was used before
 Samba4 acquired a NBT server.
 
+fruit:posix_rename
+------------------
+
+This option of the vfs_fruit VFS module that could be used to enable POSIX
+directory rename behaviour for OS X clients has been removed as it could result
+in severe problems for Windows clients.
+
+As a possible workaround it is possible to prevent creation of .DS_Store files
+(a Finder thingy to store directory view settings) on network mounts by running
+
+  $ defaults write com.apple.desktopservices DSDontWriteNetworkStores true
+
+on the Mac.
+
 
 smb.conf changes
 ================
@@ -30,7 +44,7 @@ smb.conf changes
   Parameter Name                          Description     Default
   --------------                          -----------     -------
   vfs mkdir use tmp name                  New             Auto
-
+  fruit:posix_rename                      Removed
 
 KNOWN ISSUES
 ============
diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
index 61051f90873..9e27030b660 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -328,17 +328,6 @@
 	    </listitem>
 	  </varlistentry>
 
-	  <varlistentry>
-	    <term>fruit:posix_rename = yes | no</term>
-	    <listitem>
-	      <para>Whether to enable POSIX directory rename behaviour
-	      for OS X clients. Without this, directories can't be
-	      renamed if any client has any file inside it
-	      (recursive!) open.</para>
-	      <para>The default is <emphasis>yes</emphasis>.</para>
-	    </listitem>
-	  </varlistentry>
-
 	  <varlistentry>
 	    <term>readdir_attr:aapl_rsize = yes | no</term>
 	    <listitem>
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 75e4d8f816d..75a110bfcf6 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -384,6 +384,9 @@
  * Change to Version 50 - will ship with 4.22
  * Version 50 - Change SMB_VFS_RENAMEAT() add vfs_rename_how
  * Version 50 - Add VFS_RENAME_HOW_NO_REPLACE to vfs_rename_how
+ * Version 50 - Remove FSP_POSIX_FLAGS_PATHNAMES, remove FSP_POSIX_FLAGS_RENAME
+ *              and convert struct files_struct.posix_flags to
+ *              struct files_struct.fsp_flags.posix_open
  */
 
 #define SMB_VFS_INTERFACE_VERSION 50
@@ -458,6 +461,7 @@ typedef struct files_struct {
 		bool lock_failure_seen : 1;
 		bool encryption_required : 1;
 		bool fstat_before_close : 1;
+		bool posix_open : 1;
 	} fsp_flags;
 
 	struct tevent_timer *update_write_time_event;
@@ -684,15 +688,6 @@ typedef struct files_struct {
  * In any other case use fsp_get_io_fd().
  */
 
-#define FSP_POSIX_FLAGS_OPEN		0x01
-#define FSP_POSIX_FLAGS_RENAME		0x02
-#define FSP_POSIX_FLAGS_PATHNAMES	0x04
-
-#define FSP_POSIX_FLAGS_ALL			\
-	(FSP_POSIX_FLAGS_OPEN |			\
-	 FSP_POSIX_FLAGS_PATHNAMES |		\
-	 FSP_POSIX_FLAGS_RENAME)
-
 struct vuid_cache_entry {
 	struct auth_session_info *session_info;
 	struct name_compare_entry *hide_list;
@@ -890,12 +885,7 @@ struct smb_filename {
 	struct fsp_smb_fname_link *fsp_link;
 };
 
-/*
- * smb_filename flags. Define in terms of the FSP_POSIX_FLAGS_XX
- * to keep the numeric values consistent.
- */
-
-#define SMB_FILENAME_POSIX_PATH		FSP_POSIX_FLAGS_PATHNAMES
+#define SMB_FILENAME_POSIX_PATH		0x01
 
 enum vfs_translate_direction {
 	vfs_translate_to_unix = 0,
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 4bbccdcd3bd..1db9b887907 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -2022,7 +2022,7 @@ bool set_share_mode(struct share_mode_lock *lck,
 		.time.tv_usec = fsp->open_time.tv_usec,
 		.share_file_id = fh_get_gen_id(fsp->fh),
 		.uid = (uint32_t)uid,
-		.flags = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) ?
+		.flags = fsp->fsp_flags.posix_open ?
 			SHARE_MODE_FLAG_POSIX_OPEN : 0,
 		.name_hash = fsp->name_hash,
 	};
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index e04b672cf9a..f098b7f1e79 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -1172,7 +1172,7 @@ int unlink_acl_common(struct vfs_handle_struct *handle,
 int fchmod_acl_module_common(struct vfs_handle_struct *handle,
 			     struct files_struct *fsp, mode_t mode)
 {
-	if (fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES
+	if (fsp->fsp_flags.posix_open
 	    || fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) {
 		/* Only allow this on POSIX opens. */
 		return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index f8b12c09594..d8ad4d37a4f 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -128,7 +128,6 @@ struct fruit_config_data {
 	bool unix_info_enabled;
 	bool copyfile_enabled;
 	bool veto_appledouble;
-	bool posix_rename;
 	bool aapl_zero_file_id;
 	const char *model;
 	bool time_machine;
@@ -342,9 +341,6 @@ static int init_fruit_config(vfs_handle_struct *handle)
 	config->use_copyfile = lp_parm_bool(-1, FRUIT_PARAM_TYPE_NAME,
 					   "copyfile", false);
 
-	config->posix_rename = lp_parm_bool(
-		SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME, "posix_rename", true);
-
 	config->aapl_zero_file_id =
 	    lp_parm_bool(SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME,
 			 "zero_file_id", true);
@@ -4349,15 +4345,6 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
 
 	fsp = *result;
 
-	if (global_fruit_config.nego_aapl) {
-		if (config->posix_rename && fsp->fsp_flags.is_directory) {
-			/*
-			 * Enable POSIX directory rename behaviour
-			 */
-			fsp->posix_flags |= FSP_POSIX_FLAGS_RENAME;
-		}
-	}
-
 	/*
 	 * If this is a plain open for existing files, opening an 0
 	 * byte size resource fork MUST fail with
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 6a0f7321017..0596573176d 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4686,7 +4686,7 @@ enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp)
 	if (posix_default_lock_was_set) {
 		return posix_cifsx_locktype;
 	} else {
-		return (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) ?
+		return fsp->fsp_flags.posix_open ?
 			POSIX_LOCK : WINDOWS_LOCK;
 	}
 }
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 406db604f8e..8fb2a3fc016 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1133,7 +1133,7 @@ static NTSTATUS OpenDir_fsp(
 		goto fail;
 	}
 	dir_hnd->fsp = fsp;
-	if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
+	if (fsp->fsp_flags.posix_open) {
 		dir_hnd->case_sensitive = true;
 	} else {
 		dir_hnd->case_sensitive = conn->case_sensitive;
@@ -1540,8 +1540,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
 		return status;
 	}
 
-	if (!(fsp->posix_flags & FSP_POSIX_FLAGS_RENAME) &&
-	    lp_strict_rename(SNUM(conn)) &&
+	if (lp_strict_rename(SNUM(conn)) &&
 	    have_file_open_below(fsp->conn, fsp->fsp_name))
 	{
 		return NT_STATUS_ACCESS_DENIED;
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index e59c234fedb..1b68f10c86f 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -947,7 +947,7 @@ int file_set_dosmode(connection_struct *conn,
 		return -1;
 	}
 
-	if ((smb_fname->fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) &&
+	if (smb_fname->fsp->fsp_flags.posix_open &&
 	    !lp_store_dos_attributes(SNUM(conn)))
 	{
 		return 0;
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index ed62159a495..fc6668e4186 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -148,7 +148,7 @@ void trigger_write_time_update(struct files_struct *fsp)
 {
 	int delay;
 
-	if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
+	if (fsp->fsp_flags.posix_open) {
 		/* Don't use delayed writes on POSIX files. */
 		return;
 	}
@@ -195,7 +195,7 @@ void trigger_write_time_update_immediate(struct files_struct *fsp)
 
 	init_smb_file_time(&ft);
 
-	if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
+	if (fsp->fsp_flags.posix_open) {
 		/* Don't use delayed writes on POSIX files. */
 		return;
 	}
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 50bf9b58851..a46ae938569 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -2625,7 +2625,7 @@ static bool fsp_generic_ask_sharemode(struct files_struct *fsp)
 		return false;
 	}
 
-	if (fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES) {
+	if (fsp->fsp_flags.posix_open) {
 		/* Always use filesystem for UNIX mtime query. */
 		return false;
 	}
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index f132587fb8c..0d05bd953c0 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -866,7 +866,7 @@ NTSTATUS fd_openat(const struct files_struct *dirfsp,
 	 * client should be doing this.
 	 */
 
-	if ((fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) || !lp_follow_symlinks(SNUM(conn))) {
+	if (fsp->fsp_flags.posix_open || !lp_follow_symlinks(SNUM(conn))) {
 		how.flags |= O_NOFOLLOW;
 	}
 
@@ -1270,7 +1270,7 @@ static NTSTATUS open_file(
 		SEC_FLAG_SYSTEM_SECURITY;
 	bool creating = !file_existed && (how.flags & O_CREAT);
 	bool open_fd = false;
-	bool posix_open = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN);
+	bool posix_open = fsp->fsp_flags.posix_open;
 
 	/*
 	 * Catch early an attempt to open an existing
@@ -4223,7 +4223,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 					      * requested access_mask after
 					      * the open is done. */
 	if (posix_open) {
-		fsp->posix_flags |= FSP_POSIX_FLAGS_ALL;
+		fsp->fsp_flags.posix_open = true;
 	}
 
 	if ((create_options & FILE_DELETE_ON_CLOSE) && (flags & O_CREAT) &&
@@ -5349,7 +5349,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 	fsp->sent_oplock_break = NO_BREAK_SENT;
 	fsp->fsp_flags.is_directory = true;
 	if (file_attributes & FILE_FLAG_POSIX_SEMANTICS) {
-		fsp->posix_flags |= FSP_POSIX_FLAGS_ALL;
+		fsp->fsp_flags.posix_open = true;
 	}
 
 	/* Don't store old timestamps for directory
diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c
index 666a8ebb2a6..0dba3d83df4 100644
--- a/source3/smbd/smb1_trans2.c
+++ b/source3/smbd/smb1_trans2.c
@@ -1508,7 +1508,7 @@ static void call_trans2findnext(connection_struct *conn,
 	 */
 
 	if(!continue_bit && resume_name && *resume_name) {
-		bool posix_open = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN);
+		bool posix_open = fsp->fsp_flags.posix_open;
 		char *last_name_sent = NULL;
 		bool sequential;
 
diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c
index 7c43a4e923d..2a61f963516 100644
--- a/source3/smbd/smb2_getinfo.c
+++ b/source3/smbd/smb2_getinfo.c
@@ -339,7 +339,7 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
 			break;
 
 		case SMB2_FILE_POSIX_INFORMATION:
-			if (!(fsp->posix_flags & FSP_POSIX_FLAGS_OPEN)) {
+			if (!fsp->fsp_flags.posix_open) {
 				tevent_req_nterror(req, NT_STATUS_INVALID_LEVEL);
 				return tevent_req_post(req, ev);
 			}
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index c9d810f71ba..58610a52faa 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -381,7 +381,7 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
 
 	for (i=0; i<in_lock_count; i++) {
 		bool invalid = false;
-		bool posix_handle =(fsp->posix_flags & FSP_POSIX_FLAGS_OPEN);
+		bool posix_handle = fsp->fsp_flags.posix_open;
 
 		switch (in_locks[i].flags) {
 		case SMB2_LOCK_FLAG_SHARED:
diff --git a/source3/smbd/smb2_nttrans.c b/source3/smbd/smb2_nttrans.c
index 916bde53986..33e5d13f462 100644
--- a/source3/smbd/smb2_nttrans.c
+++ b/source3/smbd/smb2_nttrans.c
@@ -189,7 +189,7 @@ static bool check_smb2_posix_chmod_ace(const struct files_struct *fsp,
 		return false;
 	}
 
-	if (!(fsp->posix_flags & FSP_POSIX_FLAGS_OPEN)) {
+	if (!fsp->fsp_flags.posix_open) {
 		return false;
 	}
 
diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c
index ebbbbb39911..cfdcc52e936 100644
--- a/source3/smbd/smb2_query_directory.c
+++ b/source3/smbd/smb2_query_directory.c
@@ -273,7 +273,7 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
 	char *p;
 	bool stop = false;
 	bool ok;
-	bool posix_dir_handle = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN);
+	bool posix_dir_handle = fsp->fsp_flags.posix_open;
 
 	req = tevent_req_create(mem_ctx, &state,
 				struct smbd_smb2_query_directory_state);
@@ -368,7 +368,7 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
 		break;
 
 	case SMB2_FIND_POSIX_INFORMATION:
-		if (!(fsp->posix_flags & FSP_POSIX_FLAGS_OPEN)) {
+		if (!fsp->fsp_flags.posix_open) {
 			tevent_req_nterror(req, NT_STATUS_INVALID_LEVEL);
 			return tevent_req_post(req, ev);
 		}
diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c
index ab8b989c0a5..d829e691ad2 100644
--- a/source3/smbd/smb2_reply.c
+++ b/source3/smbd/smb2_reply.c
@@ -1166,10 +1166,6 @@ static NTSTATUS can_rename(connection_struct *conn, files_struct *fsp,
 	}
 
 	if (S_ISDIR(fsp->fsp_name->st.st_ex_mode)) {
-		if (fsp->posix_flags & FSP_POSIX_FLAGS_RENAME) {
-			return NT_STATUS_OK;
-		}
-
 		/* If no pathnames are open below this
 		   directory, allow the rename. */
 
@@ -1413,9 +1409,9 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
 	uint32_t access_mask = SEC_DIR_ADD_FILE;
 	bool dst_exists, old_is_stream, new_is_stream;
 	int ret;
-	bool case_sensitive = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) ?
+	bool case_sensitive = fsp->fsp_flags.posix_open ?
 				true : conn->case_sensitive;
-	bool case_preserve = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) ?
+	bool case_preserve = fsp->fsp_flags.posix_open ?
 				true : conn->case_preserve;
 	struct vfs_rename_how rhow = { .flags = 0, };
 
@@ -1474,7 +1470,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
 		 * can check them separately.
 		 */
 
-		if (fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES) {
+		if (fsp->fsp_flags.posix_open) {
 			/* POSIX - no stream component. */
 			orig_lcomp_path = talloc_strdup(ctx,
 						dst_original_lcomp);
diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c
index fe19c391e0e..b7b8781a60e 100644
--- a/source3/smbd/smb2_trans2.c
+++ b/source3/smbd/smb2_trans2.c
@@ -1960,7 +1960,7 @@ static bool fsinfo_unix_valid_level(connection_struct *conn,
 				    uint16_t info_level)
 {
 	if (conn_using_smb2(conn->sconn) &&
-	    (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) &&
+	    fsp->fsp_flags.posix_open &&
 	    info_level == SMB2_FS_POSIX_INFORMATION_INTERNAL)
 	{
 		return true;
@@ -3006,7 +3006,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
 		}
 
 		if (conn_using_smb2(conn->sconn) &&
-		    (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN))
+		    fsp->fsp_flags.posix_open)
 		{
 			DBG_DEBUG("SMB2 posix open\n");
 			ok = true;
@@ -3677,7 +3677,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
 			if (fsp == NULL) {
 				return NT_STATUS_INVALID_HANDLE;
 			}
-			if (!(fsp->posix_flags & FSP_POSIX_FLAGS_OPEN)) {
+			if (!fsp->fsp_flags.posix_open) {
 				return NT_STATUS_INVALID_LEVEL;
 			}
 
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index ce9c9af3fd2..16c084dda51 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1172,7 +1172,7 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp)
 	}
 
 	if (fsp_get_pathref_fd(fsp) == -1) {
-		if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
+		if (fsp->fsp_flags.posix_open) {
 			ret = SMB_VFS_LSTAT(fsp->conn, fsp->fsp_name);
 		} else {
 			ret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name);
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index b9cab0c5467..c748326483a 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -3984,137 +3984,6 @@ done:
 	return ret;
 }
 
-/* Renaming a directory with open file, should work for OS X AAPL clients */
-static bool test_rename_dir_openfile(struct torture_context *torture,
-				     struct smb2_tree *tree)
-{
-	bool ret = true;
-	NTSTATUS status;
-	union smb_open io;
-	union smb_close cl;
-	union smb_setfileinfo sinfo;
-	struct smb2_handle d1, h1;
-	const char *renamedir = BASEDIR "-new";
-	bool server_is_osx = torture_setting_bool(torture, "osx", false);
-
-	smb2_deltree(tree, BASEDIR);
-	smb2_util_rmdir(tree, BASEDIR);
-	smb2_deltree(tree, renamedir);
-
-	ZERO_STRUCT(io.smb2);
-	io.generic.level = RAW_OPEN_SMB2;
-	io.smb2.in.create_flags = 0;
-	io.smb2.in.desired_access = 0x0017019f;
-	io.smb2.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
-	io.smb2.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
-	io.smb2.in.share_access = 0;
-	io.smb2.in.alloc_size = 0;
-	io.smb2.in.create_disposition = NTCREATEX_DISP_CREATE;
-	io.smb2.in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS;
-	io.smb2.in.security_flags = 0;
-	io.smb2.in.fname = BASEDIR;
-
-	status = smb2_create(tree, torture, &(io.smb2));
-	torture_assert_ntstatus_ok(torture, status, "smb2_create dir");
-	d1 = io.smb2.out.file.handle;
-
-	ZERO_STRUCT(io.smb2);
-	io.generic.level = RAW_OPEN_SMB2;
-	io.smb2.in.create_flags = 0;
-	io.smb2.in.desired_access = 0x0017019f;
-	io.smb2.in.create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE;
-	io.smb2.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
-	io.smb2.in.share_access = 0;
-	io.smb2.in.alloc_size = 0;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list