[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-286-gfbaa849

Tim Prouty tprouty at samba.org
Thu Jul 9 04:39:48 GMT 2009


The branch, master has been updated
       via  fbaa8497a5c8c209de9ca86bebf8387e6d33a608 (commit)
       via  02aad05e0ed3e1d4790b323a94e43184f9c4e643 (commit)
       via  dcc97c5ad7d274e88ee2be2bbd37234030737bc2 (commit)
       via  3a7d372e2eb5ab00986aafe69ac715a68faa077f (commit)
       via  83e5ac569577566fa171b8f4288e26e5129015ab (commit)
       via  161e182b65ceda833e0bebc48ef404cdd399f8d7 (commit)
       via  1a1d10d22f7a2eebd22e76614c3c74b4d49e5c33 (commit)
       via  69c8795b672054cb6b5a85cc5f8961099425bd7a (commit)
      from  400c18a8c4098b4ba86d32a236e5d89014774f3f (commit)

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


- Log -----------------------------------------------------------------
commit fbaa8497a5c8c209de9ca86bebf8387e6d33a608
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Jul 8 20:15:02 2009 -0700

    s3: Repace a char * with an smb_filename struct in reply_rmdir

commit 02aad05e0ed3e1d4790b323a94e43184f9c4e643
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Jul 8 16:53:01 2009 -0700

    s3: Prepare open.c to switch fsp_name to an smb_filename struct

commit dcc97c5ad7d274e88ee2be2bbd37234030737bc2
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Jul 8 17:53:05 2009 -0700

    s3 plumb smb_filename through smb_set_file_allocation_info()

commit 3a7d372e2eb5ab00986aafe69ac715a68faa077f
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Jul 8 16:22:44 2009 -0700

    s3: Change the share_mode_lock struct to store a base_name and stream_name

commit 83e5ac569577566fa171b8f4288e26e5129015ab
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Jul 8 14:27:06 2009 -0700

    s3: Make some arguments to (parse|unparse)_share_modes() const

commit 161e182b65ceda833e0bebc48ef404cdd399f8d7
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Jul 8 14:08:04 2009 -0700

    s3: Remove is_ntfs_stream_name() and split_ntfs_stream_name()
    
    Actually I moved split_ntfs_stream_name into torture.c which is the one
    consumer of it.  This could probably be changed at some point.

commit 1a1d10d22f7a2eebd22e76614c3c74b4d49e5c33
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Jul 8 12:24:03 2009 -0700

    s3: Plumb smb_filename through dos_mode() and related funtions

commit 69c8795b672054cb6b5a85cc5f8961099425bd7a
Author: Tim Prouty <tprouty at samba.org>
Date:   Tue Jul 7 19:20:22 2009 -0700

    s3: convert unix_mode to take an smb_filename

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

Summary of changes:
 source3/include/proto.h             |   28 ++--
 source3/include/smb.h               |    3 +-
 source3/lib/util.c                  |   90 -----------
 source3/locking/locking.c           |   97 ++++++++----
 source3/modules/nfs4_acls.c         |   12 ++-
 source3/modules/onefs_acl.c         |   15 ++-
 source3/modules/onefs_open.c        |   58 ++++----
 source3/modules/onefs_streams.c     |   48 ------
 source3/modules/vfs_streams_xattr.c |   21 ++-
 source3/smbd/dir.c                  |   48 +++---
 source3/smbd/dosmode.c              |  217 +++++++++++++++------------
 source3/smbd/fileio.c               |   34 ++---
 source3/smbd/nttrans.c              |   67 +--------
 source3/smbd/open.c                 |  124 +++++++++-------
 source3/smbd/posix_acls.c           |  281 ++++++++++++++++++++++-------------
 source3/smbd/reply.c                |   93 +++++++-----
 source3/smbd/smb2_create.c          |   13 ++-
 source3/smbd/trans2.c               |  158 ++++++++++----------
 source3/torture/torture.c           |   90 +++++++++++
 source3/utils/status.c              |   18 ++-
 20 files changed, 807 insertions(+), 708 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index f835da2..f887b4e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1202,8 +1202,6 @@ void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const c
 void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
 void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
 void *talloc_zeronull(const void *context, size_t size, const char *name);
-NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
-				char **pbase, char **pstream);
 bool is_valid_policy_hnd(const struct policy_handle *hnd);
 bool policy_hnd_equal(const struct policy_handle *hnd1,
 		      const struct policy_handle *hnd2);
@@ -3445,16 +3443,14 @@ char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e)
 struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
 					    const struct file_id id,
 					    const char *servicepath,
-					    const char *fname,
+					    const struct smb_filename *smb_fname,
 					    const struct timespec *old_write_time);
 struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
-						  const struct file_id id,
-						  const char *servicepath,
-						  const char *fname);
+						  const struct file_id id);
 bool rename_share_filename(struct messaging_context *msg_ctx,
 			struct share_mode_lock *lck,
 			const char *servicepath,
-			const char *newname);
+			const struct smb_filename *smb_fname);
 void get_file_infos(struct file_id id,
 		    bool *delete_on_close,
 		    struct timespec *write_time);
@@ -6234,11 +6230,13 @@ bool smbd_setup_mdns_registration(struct tevent_context *ev,
 
 /* The following definitions come from smbd/dosmode.c  */
 
-mode_t unix_mode(connection_struct *conn, int dosmode, const char *fname,
+mode_t unix_mode(connection_struct *conn, int dosmode,
+		 const struct smb_filename *smb_fname,
 		 const char *inherit_from_dir);
-uint32 dos_mode_msdfs(connection_struct *conn, const char *path, const SMB_STRUCT_STAT *sbuf);
+uint32 dos_mode_msdfs(connection_struct *conn,
+		      const struct smb_filename *smb_fname);
 int dos_attributes_to_stat_dos_flags(uint32_t dosmode);
-uint32 dos_mode(connection_struct *conn, const char *path, const SMB_STRUCT_STAT *sbuf);
+uint32 dos_mode(connection_struct *conn, const struct smb_filename *smb_fname);
 int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
 		     uint32 dosmode, const char *parent_dir, bool newfile);
 int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
@@ -6546,7 +6544,6 @@ void send_nt_replies(connection_struct *conn,
 			struct smb_request *req, NTSTATUS nt_error,
 		     char *params, int paramsize,
 		     char *pdata, int datasize);
-bool is_ntfs_stream_name(const char *fname);
 bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname);
 bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname);
 void reply_ntcreate_and_X(struct smb_request *req);
@@ -6582,7 +6579,7 @@ bool open_match_attributes(connection_struct *conn,
 NTSTATUS fcb_or_dos_open(struct smb_request *req,
 			 connection_struct *conn,
 			 files_struct *fsp_to_dup_into,
-			 const char *fname,
+			 const struct smb_filename *smb_fname,
 			 struct file_id id,
 			 uint16 file_pid,
 			 uint16 vuid,
@@ -6595,8 +6592,8 @@ bool map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func
 				 uint32 *pcreate_disposition,
 				 uint32 *pcreate_options);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
-			  const char *fname,
-			  SMB_STRUCT_STAT *psbuf, files_struct **result);
+			  struct smb_filename *smb_fname,
+			  files_struct **result);
 NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
 			  struct smb_filename *smb_dname);
@@ -6717,7 +6714,8 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
 			   SEC_DESC **ppdesc);
 NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name,
 			  uint32_t security_info, SEC_DESC **ppdesc);
-int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid);
+int try_chown(connection_struct *conn, struct smb_filename *smb_fname,
+	      uid_t uid, gid_t gid);
 NTSTATUS append_parent_acl(files_struct *fsp,
 				const SEC_DESC *pcsd,
 				SEC_DESC **pp_new_sd);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 87fd2b0..9afeb67 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -774,7 +774,8 @@ Offset  Data			length.
 
 struct share_mode_lock {
 	const char *servicepath; /* canonicalized. */
-	const char *filename;
+	const char *base_name;
+	const char *stream_name;
 	struct file_id id;
 	int num_share_modes;
 	struct share_mode_entry *share_modes;
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 77af939..835e4c0 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3001,96 +3001,6 @@ void *talloc_zeronull(const void *context, size_t size, const char *name)
 }
 #endif
 
-/* Split a path name into filename and stream name components. Canonicalise
- * such that an implicit $DATA token is always explicit.
- *
- * The "specification" of this function can be found in the
- * run_local_stream_name() function in torture.c, I've tried those
- * combinations against a W2k3 server.
- */
-
-NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
-				char **pbase, char **pstream)
-{
-	char *base = NULL;
-	char *stream = NULL;
-	char *sname; /* stream name */
-	const char *stype; /* stream type */
-
-	DEBUG(10, ("split_ntfs_stream_name called for [%s]\n", fname));
-
-	sname = strchr_m(fname, ':');
-
-	if (lp_posix_pathnames() || (sname == NULL)) {
-		if (pbase != NULL) {
-			base = talloc_strdup(mem_ctx, fname);
-			NT_STATUS_HAVE_NO_MEMORY(base);
-		}
-		goto done;
-	}
-
-	if (pbase != NULL) {
-		base = talloc_strndup(mem_ctx, fname, PTR_DIFF(sname, fname));
-		NT_STATUS_HAVE_NO_MEMORY(base);
-	}
-
-	sname += 1;
-
-	stype = strchr_m(sname, ':');
-
-	if (stype == NULL) {
-		sname = talloc_strdup(mem_ctx, sname);
-		stype = "$DATA";
-	}
-	else {
-		if (StrCaseCmp(stype, ":$DATA") != 0) {
-			/*
-			 * If there is an explicit stream type, so far we only
-			 * allow $DATA. Is there anything else allowed? -- vl
-			 */
-			DEBUG(10, ("[%s] is an invalid stream type\n", stype));
-			TALLOC_FREE(base);
-			return NT_STATUS_OBJECT_NAME_INVALID;
-		}
-		sname = talloc_strndup(mem_ctx, sname, PTR_DIFF(stype, sname));
-		stype += 1;
-	}
-
-	if (sname == NULL) {
-		TALLOC_FREE(base);
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	if (sname[0] == '\0') {
-		/*
-		 * no stream name, so no stream
-		 */
-		goto done;
-	}
-
-	if (pstream != NULL) {
-		stream = talloc_asprintf(mem_ctx, "%s:%s", sname, stype);
-		if (stream == NULL) {
-			TALLOC_FREE(sname);
-			TALLOC_FREE(base);
-			return NT_STATUS_NO_MEMORY;
-		}
-		/*
-		 * upper-case the type field
-		 */
-		strupper_m(strchr_m(stream, ':')+1);
-	}
-
- done:
-	if (pbase != NULL) {
-		*pbase = base;
-	}
-	if (pstream != NULL) {
-		*pstream = stream;
-	}
-	return NT_STATUS_OK;
-}
-
 bool is_valid_policy_hnd(const struct policy_handle *hnd)
 {
 	struct policy_handle tmp;
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index dd735be..91fe137 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -524,7 +524,7 @@ static void print_share_mode_table(struct locking_data *data)
  Get all share mode entries for a dev/inode pair.
 ********************************************************************/
 
-static bool parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
+static bool parse_share_modes(const TDB_DATA dbuf, struct share_mode_lock *lck)
 {
 	struct locking_data data;
 	int i;
@@ -630,11 +630,17 @@ static bool parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
 		(lck->num_share_modes *	sizeof(struct share_mode_entry)) +
 		data.u.s.delete_token_size;
 
-	lck->filename = (const char *)dbuf.dptr + sizeof(struct locking_data) +
+	lck->base_name = (const char *)dbuf.dptr + sizeof(struct locking_data) +
 		(lck->num_share_modes *	sizeof(struct share_mode_entry)) +
 		data.u.s.delete_token_size +
 		strlen(lck->servicepath) + 1;
 
+	lck->stream_name = (const char *)dbuf.dptr + sizeof(struct locking_data) +
+		(lck->num_share_modes *	sizeof(struct share_mode_entry)) +
+		data.u.s.delete_token_size +
+		strlen(lck->servicepath) + 1 +
+		strlen(lck->base_name) + 1;
+
 	/*
 	 * Ensure that each entry has a real process attached.
 	 */
@@ -659,14 +665,14 @@ static bool parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
 	return True;
 }
 
-static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
+static TDB_DATA unparse_share_modes(const struct share_mode_lock *lck)
 {
 	TDB_DATA result;
 	int num_valid = 0;
 	int i;
 	struct locking_data *data;
 	ssize_t offset;
-	ssize_t sp_len;
+	ssize_t sp_len, bn_len, sn_len;
 	uint32 delete_token_size;
 
 	result.dptr = NULL;
@@ -683,6 +689,9 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
 	}
 
 	sp_len = strlen(lck->servicepath);
+	bn_len = strlen(lck->base_name);
+	sn_len = lck->stream_name != NULL ? strlen(lck->stream_name) : 0;
+
 	delete_token_size = (lck->delete_token ?
 			(sizeof(uid_t) + sizeof(gid_t) + (lck->delete_token->ngroups*sizeof(gid_t))) : 0);
 
@@ -690,7 +699,8 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
 		lck->num_share_modes * sizeof(struct share_mode_entry) +
 		delete_token_size +
 		sp_len + 1 +
-		strlen(lck->filename) + 1;
+		bn_len + 1 +
+		sn_len + 1;
 	result.dptr = TALLOC_ARRAY(lck, uint8, result.dsize);
 
 	if (result.dptr == NULL) {
@@ -740,7 +750,10 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
 	safe_strcpy((char *)result.dptr + offset, lck->servicepath,
 		    result.dsize - offset - 1);
 	offset += sp_len + 1;
-	safe_strcpy((char *)result.dptr + offset, lck->filename,
+	safe_strcpy((char *)result.dptr + offset, lck->base_name,
+		    result.dsize - offset - 1);
+	offset += bn_len + 1;
+	safe_strcpy((char *)result.dptr + offset, lck->stream_name,
 		    result.dsize - offset - 1);
 
 	if (DEBUGLEVEL >= 10) {
@@ -789,7 +802,7 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
 static bool fill_share_mode_lock(struct share_mode_lock *lck,
 				 struct file_id id,
 				 const char *servicepath,
-				 const char *fname,
+				 const struct smb_filename *smb_fname,
 				 TDB_DATA share_mode_data,
 				 const struct timespec *old_write_time)
 {
@@ -797,7 +810,8 @@ static bool fill_share_mode_lock(struct share_mode_lock *lck,
 	   valid even if parse_share_modes fails. */
 
 	lck->servicepath = NULL;
-	lck->filename = NULL;
+	lck->base_name = NULL;
+	lck->stream_name = NULL;
 	lck->id = id;
 	lck->num_share_modes = 0;
 	lck->share_modes = NULL;
@@ -811,13 +825,20 @@ static bool fill_share_mode_lock(struct share_mode_lock *lck,
 	lck->fresh = (share_mode_data.dptr == NULL);
 
 	if (lck->fresh) {
-		if (fname == NULL || servicepath == NULL
+		bool has_stream;
+		if (smb_fname == NULL || servicepath == NULL
 		    || old_write_time == NULL) {
 			return False;
 		}
-		lck->filename = talloc_strdup(lck, fname);
+
+		has_stream = smb_fname->stream_name != NULL;
+
+		lck->base_name = talloc_strdup(lck, smb_fname->base_name);
+		lck->stream_name = talloc_strdup(lck, smb_fname->stream_name);
 		lck->servicepath = talloc_strdup(lck, servicepath);
-		if (lck->filename == NULL || lck->servicepath == NULL) {
+		if (lck->base_name == NULL ||
+		    (has_stream && lck->stream_name == NULL) ||
+		    lck->servicepath == NULL) {
 			DEBUG(0, ("talloc failed\n"));
 			return False;
 		}
@@ -835,7 +856,7 @@ static bool fill_share_mode_lock(struct share_mode_lock *lck,
 struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
 					    const struct file_id id,
 					    const char *servicepath,
-					    const char *fname,
+					    const struct smb_filename *smb_fname,
 					    const struct timespec *old_write_time)
 {
 	struct share_mode_lock *lck;
@@ -853,7 +874,7 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-	if (!fill_share_mode_lock(lck, id, servicepath, fname,
+	if (!fill_share_mode_lock(lck, id, servicepath, smb_fname,
 				  lck->record->value, old_write_time)) {
 		DEBUG(3, ("fill_share_mode_lock failed\n"));
 		TALLOC_FREE(lck);
@@ -866,9 +887,7 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
 }
 
 struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
-						  const struct file_id id,
-						  const char *servicepath,
-						  const char *fname)
+						  const struct file_id id)
 {
 	struct share_mode_lock *lck;
 	struct file_id tmp;
@@ -886,7 +905,7 @@ struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-	if (!fill_share_mode_lock(lck, id, servicepath, fname, data, NULL)) {
+	if (!fill_share_mode_lock(lck, id, NULL, NULL, data, NULL)) {
 		DEBUG(10, ("fetch_share_mode_unlocked: no share_mode record "
 			   "around (file not open)\n"));
 		TALLOC_FREE(lck);
@@ -906,37 +925,49 @@ struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
 bool rename_share_filename(struct messaging_context *msg_ctx,
 			struct share_mode_lock *lck,
 			const char *servicepath,
-			const char *newname)
+			const struct smb_filename *smb_fname_dst)
 {
 	size_t sp_len;
-	size_t fn_len;
+	size_t bn_len;
+	size_t sn_len;
 	size_t msg_len;
 	char *frm = NULL;
 	int i;
+	bool strip_two_chars = false;
+	bool has_stream = smb_fname_dst->stream_name != NULL;
 
 	DEBUG(10, ("rename_share_filename: servicepath %s newname %s\n",
-		servicepath, newname));
+		   servicepath, smb_fname_dst->base_name));
 
 	/*
 	 * rename_internal_fsp() and rename_internals() add './' to
 	 * head of newname if newname does not contain a '/'.
 	 */
-	while (newname[0] && newname[1] && newname[0] == '.' && newname[1] == '/') {
-		newname += 2;
+	if (smb_fname_dst->base_name[0] &&
+	    smb_fname_dst->base_name[1] &&
+	    smb_fname_dst->base_name[0] == '.' &&
+	    smb_fname_dst->base_name[1] == '/') {
+		strip_two_chars = true;
 	}
 
 	lck->servicepath = talloc_strdup(lck, servicepath);
-	lck->filename = talloc_strdup(lck, newname);
-	if (lck->filename == NULL || lck->servicepath == NULL) {
+	lck->base_name = talloc_strdup(lck, smb_fname_dst->base_name +
+				       (strip_two_chars ? 2 : 0));
+	lck->stream_name = talloc_strdup(lck, smb_fname_dst->stream_name);
+	if (lck->base_name == NULL ||
+	    (has_stream && lck->stream_name == NULL) ||
+	    lck->servicepath == NULL) {
 		DEBUG(0, ("rename_share_filename: talloc failed\n"));
 		return False;
 	}
 	lck->modified = True;
 
 	sp_len = strlen(lck->servicepath);
-	fn_len = strlen(lck->filename);
+	bn_len = strlen(lck->base_name);
+	sn_len = has_stream ? strlen(lck->stream_name) : 0;
 
-	msg_len = MSG_FILE_RENAMED_MIN_SIZE + sp_len + 1 + fn_len + 1;
+	msg_len = MSG_FILE_RENAMED_MIN_SIZE + sp_len + 1 + bn_len + 1 +
+	    sn_len + 1;
 
 	/* Set up the name changed message. */
 	frm = TALLOC_ARRAY(lck, char, msg_len);
@@ -949,7 +980,9 @@ bool rename_share_filename(struct messaging_context *msg_ctx,
 	DEBUG(10,("rename_share_filename: msg_len = %u\n", (unsigned int)msg_len ));
 
 	safe_strcpy(&frm[24], lck->servicepath, sp_len);
-	safe_strcpy(&frm[24 + sp_len + 1], lck->filename, fn_len);
+	safe_strcpy(&frm[24 + sp_len + 1], lck->base_name, bn_len);
+	safe_strcpy(&frm[24 + sp_len + 1 + bn_len + 1], lck->stream_name,
+		    sn_len);
 
 	/* Send the messages. */
 	for (i=0; i<lck->num_share_modes; i++) {
@@ -962,11 +995,13 @@ bool rename_share_filename(struct messaging_context *msg_ctx,
 			continue;
 		}
 
-		DEBUG(10,("rename_share_filename: sending rename message to pid %s "
-			  "file_id %s sharepath %s newname %s\n",
+		DEBUG(10,("rename_share_filename: sending rename message to "
+			  "pid %s file_id %s sharepath %s base_name %s "
+			  "stream_name %s\n",
 			  procid_str_static(&se->pid),
 			  file_id_string_tos(&lck->id),
-			  lck->servicepath, lck->filename ));
+			  lck->servicepath, lck->base_name,
+			has_stream ? lck->stream_name : ""));
 
 		messaging_send_buf(msg_ctx, se->pid, MSG_SMB_FILE_RENAME,
 				   (uint8 *)frm, msg_len);
@@ -989,7 +1024,7 @@ void get_file_infos(struct file_id id,
 		ZERO_STRUCTP(write_time);
 	}
 
-	if (!(lck = fetch_share_mode_unlocked(talloc_tos(), id, NULL, NULL))) {
+	if (!(lck = fetch_share_mode_unlocked(talloc_tos(), id))) {
 		return;
 	}
 
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 70bdaa8..9b3c872 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -743,12 +743,22 @@ NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp,
 		}
 		if (((newUID != (uid_t)-1) && (sbuf.st_ex_uid != newUID)) ||
 		    ((newGID != (gid_t)-1) && (sbuf.st_ex_gid != newGID))) {
-			if(try_chown(fsp->conn, fsp->fsp_name, newUID, newGID)) {
+			struct smb_filename *smb_fname = NULL;
+			NTSTATUS status;
+
+			status = create_synthetic_smb_fname_split(talloc_tos(),
+			    fsp->fsp_name, NULL, &smb_fname);
+			if (!NT_STATUS_IS_OK(status)) {
+				return status;
+			}
+			if(try_chown(fsp->conn, smb_fname, newUID, newGID)) {
 				DEBUG(3,("chown %s, %u, %u failed. Error = %s.\n",
 					 fsp->fsp_name, (unsigned int)newUID, (unsigned int)newGID, 
 					 strerror(errno)));
+				TALLOC_FREE(smb_fname);
 				return map_nt_error_from_unix(errno);
 			}
+			TALLOC_FREE(smb_fname);
 
 			DEBUG(10,("chown %s, %u, %u succeeded.\n",
 				  fsp->fsp_name, (unsigned int)newUID, (unsigned int)newGID));
diff --git a/source3/modules/onefs_acl.c b/source3/modules/onefs_acl.c
index 81bdfd2..5c72d10 100644
--- a/source3/modules/onefs_acl.c
+++ b/source3/modules/onefs_acl.c
@@ -542,14 +542,25 @@ static bool add_sfs_aces(files_struct *fsp, struct ifs_security_descriptor *sd)
 	/* Only continue if this is a synthetic ACL and a directory. */
 	if (S_ISDIR(sbuf.st_ex_mode) &&
 	    (sbuf.st_ex_flags & SF_HASNTFSACL) == 0) {
+		struct smb_filename *smb_fname = NULL;
 		struct ifs_ace new_aces[6];
 		struct ifs_ace *old_aces;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list