summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarolin Seeger <kseeger@samba.org>2008-11-17 14:02:56 +0100
committerKarolin Seeger <kseeger@samba.org>2008-11-17 14:02:56 +0100
commit8af08208de0bc78420e57ff3d643dfbbb9a4c19c (patch)
treef9210d86df44d72209a9f7fc94daaff79850d63e
parenta2088d3a7e3a25ce9c69de72037710ed17349721 (diff)
downloadsamba-8af08208de0bc78420e57ff3d643dfbbb9a4c19c.tar.gz
samba-8af08208de0bc78420e57ff3d643dfbbb9a4c19c.tar.xz
samba-8af08208de0bc78420e57ff3d643dfbbb9a4c19c.zip
Revert "Fix bug #5783 FindFirst fails where search pattern == mangled filename."
This reverts commit fc9247572e0ace4956845e279c63c9d00fa667bd.
-rw-r--r--source/smbd/filename.c3
-rw-r--r--source/smbd/trans2.c13
2 files changed, 8 insertions, 8 deletions
diff --git a/source/smbd/filename.c b/source/smbd/filename.c
index 562f1e8d943..41a0b9296a5 100644
--- a/source/smbd/filename.c
+++ b/source/smbd/filename.c
@@ -101,7 +101,8 @@ 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. If saved_last_component == 0 then nothing
+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
is returned there.
If last_component_wcard is true then a MS wildcard was detected and
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index f3b45ad1fd0..13105dce0fc 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -1885,7 +1885,7 @@ static void call_trans2findfirst(connection_struct *conn,
bool requires_resume_key;
int info_level;
char *directory = NULL;
- char *mask = NULL;
+ const char *mask = NULL;
char *p;
int last_entry_off=0;
int dptr_num = -1;
@@ -1973,7 +1973,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, &mask, &sbuf);
+ ntstatus = unix_convert(ctx, conn, directory, True, &directory, NULL, &sbuf);
if (!NT_STATUS_IS_OK(ntstatus)) {
reply_nterror(req, ntstatus);
return;
@@ -1989,12 +1989,10 @@ 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 = talloc_strdup(ctx,"*");
- if (!mask) {
- reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
- }
+ mask = "*";
mask_contains_wcard = True;
+ } else {
+ mask = directory;
}
directory = talloc_strdup(talloc_tos(), "./");
if (!directory) {
@@ -2002,6 +2000,7 @@ close_if_end = %d requires_resume_key = %d level = 0x%x, max_data_bytes = %d\n",
return;
}
} else {
+ mask = p+1;
*p = 0;
}