[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1564-g7bb7a0d

Jeremy Allison jra at samba.org
Sun Jan 20 06:06:52 GMT 2008


The branch, v3-2-test has been updated
       via  7bb7a0def6518784befa75e5303289d2b4d36dd4 (commit)
      from  487c43f9284598a3c60b06fc60e5c50844e11b87 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 7bb7a0def6518784befa75e5303289d2b4d36dd4
Author: Jeremy Allison <jra at samba.org>
Date:   Sat Jan 19 21:53:49 2008 -0800

    Couple of minor fixes for POSIX pathname processing in the
    new stream code. (1) In smbd/filename, don't split the name at
    ':' if we know it's a posix path (this should be parameterized....).
    (2). When calling posix_mkdir, we get the flag FILE_FLAG_POSIX_SEMANTICS
    passed to open_directory(). I know for a posix client lp_posix_pathnames
    should be true (which is checked for in is_ntfs_stream_name() but we
    have an explicit flag here, so let's use it.
    Jeremy.

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

Summary of changes:
 source/smbd/filename.c |   18 ++++++++++--------
 source/smbd/open.c     |    2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/filename.c b/source/smbd/filename.c
index 1d44c74..10e9583 100644
--- a/source/smbd/filename.c
+++ b/source/smbd/filename.c
@@ -214,16 +214,18 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	stream = strchr_m(name, ':');
+	if (!lp_posix_pathnames()) {
+		stream = strchr_m(name, ':');
 
-	if (stream != NULL) {
-		char *tmp = talloc_strdup(ctx, stream);
-		if (tmp == NULL) {
-			TALLOC_FREE(name);
-			return NT_STATUS_NO_MEMORY;
+		if (stream != NULL) {
+			char *tmp = talloc_strdup(ctx, stream);
+			if (tmp == NULL) {
+				TALLOC_FREE(name);
+				return NT_STATUS_NO_MEMORY;
+			}
+			*stream = '\0';
+			stream = tmp;
 		}
-		*stream = '\0';
-		stream = tmp;
 	}
 
 	/*
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 0d6e07a..ad221c3 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -2106,7 +2106,7 @@ NTSTATUS open_directory(connection_struct *conn,
 		 (unsigned int)create_disposition,
 		 (unsigned int)file_attributes));
 
-	if (is_ntfs_stream_name(fname)) {
+	if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS) && is_ntfs_stream_name(fname)) {
 		DEBUG(2, ("open_directory: %s is a stream name!\n", fname));
 		return NT_STATUS_NOT_A_DIRECTORY;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list