summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-01-20 16:30:28 -0800
committerJeremy Allison <jra@samba.org>2011-01-20 16:30:28 -0800
commitde4b09ca01b1747c49bb0058147977ff39d054bb (patch)
tree467e1ca7e9917140206989abfb87e77eb96dd909 /source3/smbd
parentbb54f72b94dca9206bf377b0d6a4b669e389e339 (diff)
downloadsamba-de4b09ca01b1747c49bb0058147977ff39d054bb.tar.gz
samba-de4b09ca01b1747c49bb0058147977ff39d054bb.tar.bz2
samba-de4b09ca01b1747c49bb0058147977ff39d054bb.zip
Ensure we don't use "./" in findfirst pathnames. Use a directory open of "." instead.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index ddae99d7cc..90a878d17e 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2352,13 +2352,17 @@ close_if_end = %d requires_resume_key = %d level = 0x%x, max_data_bytes = %d\n",
}
mask_contains_wcard = True;
}
- directory = talloc_strdup(talloc_tos(), "./");
+ } else {
+ *p = 0;
+ }
+
+ if (p == NULL || p == directory) {
+ /* Ensure we don't have a directory name of "". */
+ directory = talloc_strdup(talloc_tos(), ".");
if (!directory) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
goto out;
}
- } else {
- *p = 0;
}
DEBUG(5,("dir=%s, mask = %s\n",directory, mask));
@@ -6238,7 +6242,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
if (p) {
p[1] = '\0';
} else {
- base_name = talloc_strdup(ctx, "./");
+ base_name = talloc_strdup(ctx, "");
if (!base_name) {
return NT_STATUS_NO_MEMORY;
}