[SCM] Samba Shared Repository - branch master updated - d275cc762dad1985045d381ca211e92234d9d77d

Jeremy Allison jra at samba.org
Tue Sep 23 22:06:49 GMT 2008


The branch, master has been updated
       via  d275cc762dad1985045d381ca211e92234d9d77d (commit)
      from  0bbbe2c21fdcbdc492b78b84897f85eb60ec5b00 (commit)

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


- Log -----------------------------------------------------------------
commit d275cc762dad1985045d381ca211e92234d9d77d
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Sep 23 15:05:45 2008 -0700

    Fix bug #5783 FindFirst fails where search pattern == mangled filename.
    That was an old and subtle bug.
    Jeremy.

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

Summary of changes:
 source3/smbd/filename.c |    3 +--
 source3/smbd/trans2.c   |   13 +++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 41a0b92..562f1e8 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -101,8 +101,7 @@ get any fatal errors that should immediately terminate the calling
 SMB processing whilst resolving.
 
 If the saved_last_component != 0, then the unmodified last component
-of the pathname is returned there. This is used in an exceptional
-case in reply_mv (so far). If saved_last_component == 0 then nothing
+of the pathname is returned there. If saved_last_component == 0 then nothing
 is returned there.
 
 If last_component_wcard is true then a MS wildcard was detected and
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 2e2da5c..1e2095a 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1892,7 +1892,7 @@ static void call_trans2findfirst(connection_struct *conn,
 	bool requires_resume_key;
 	int info_level;
 	char *directory = NULL;
-	const char *mask = NULL;
+	char *mask = NULL;
 	char *p;
 	int last_entry_off=0;
 	int dptr_num = -1;
@@ -1980,7 +1980,7 @@ close_if_end = %d requires_resume_key = %d level = 0x%x, max_data_bytes = %d\n",
 		return;
 	}
 
-	ntstatus = unix_convert(ctx, conn, directory, True, &directory, NULL, &sbuf);
+	ntstatus = unix_convert(ctx, conn, directory, True, &directory, &mask, &sbuf);
 	if (!NT_STATUS_IS_OK(ntstatus)) {
 		reply_nterror(req, ntstatus);
 		return;
@@ -1996,10 +1996,12 @@ close_if_end = %d requires_resume_key = %d level = 0x%x, max_data_bytes = %d\n",
 	if(p == NULL) {
 		/* Windows and OS/2 systems treat search on the root '\' as if it were '\*' */
 		if((directory[0] == '.') && (directory[1] == '\0')) {
-			mask = "*";
+			mask = talloc_strdup(ctx,"*");
+			if (!mask) {
+				reply_nterror(req, NT_STATUS_NO_MEMORY);
+				return;
+			}
 			mask_contains_wcard = True;
-		} else {
-			mask = directory;
 		}
 		directory = talloc_strdup(talloc_tos(), "./");
 		if (!directory) {
@@ -2007,7 +2009,6 @@ close_if_end = %d requires_resume_key = %d level = 0x%x, max_data_bytes = %d\n",
 			return;
 		}
 	} else {
-		mask = p+1;
 		*p = 0;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list