summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-04-09 22:46:31 -0700
committerKarolin Seeger <kseeger@samba.org>2009-04-17 10:06:27 +0200
commit8a74aeb1b0fc42687adede34bfc131d486b8873b (patch)
treef547c458616547c680040f94efda57caab1ee969
parent892ffce717cf1e0ad9eed2d9ebcc4df88b58f3d8 (diff)
downloadsamba-8a74aeb1b0fc42687adede34bfc131d486b8873b.tar.gz
samba-8a74aeb1b0fc42687adede34bfc131d486b8873b.tar.xz
samba-8a74aeb1b0fc42687adede34bfc131d486b8873b.zip
Fix bug #6254 - PUT/GET produces an error in IPv6 to a smb-server(3.3)
has parameter "msdfs root = yes" This was broken by the refactoring around create_file(). MSDFS pathname processing must be done FIRST. MSDFS pathnames containing IPv6 addresses can be confused with NTFS stream names (they contain ":" characters. Jeremy. (cherry picked from commit f63751ad272b9caade7855665b8a3352cefe2ae7)
-rw-r--r--source/smbd/open.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 064e17c72c5..658cc5ac65b 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -3282,6 +3282,29 @@ NTSTATUS create_file(connection_struct *conn,
(unsigned int)root_dir_fid,
ea_list, sd, fname));
+ /* MSDFS pathname processing must be done FIRST.
+ MSDFS pathnames containing IPv6 addresses can
+ be confused with NTFS stream names (they contain
+ ":" characters. JRA. */
+
+ if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) {
+ char *resolved_fname;
+
+ status = resolve_dfspath(talloc_tos(), conn, true, fname,
+ &resolved_fname);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ /*
+ * For PATH_NOT_COVERED we had
+ * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
+ * ERRSRV, ERRbadpath);
+ * Need to fix in callers
+ */
+ goto fail;
+ }
+ fname = resolved_fname;
+ }
+
/*
* Get the file name.
*/
@@ -3409,24 +3432,6 @@ NTSTATUS create_file(connection_struct *conn,
}
}
- if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) {
- char *resolved_fname;
-
- status = resolve_dfspath(talloc_tos(), conn, true, fname,
- &resolved_fname);
-
- if (!NT_STATUS_IS_OK(status)) {
- /*
- * For PATH_NOT_COVERED we had
- * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
- * ERRSRV, ERRbadpath);
- * Need to fix in callers
- */
- goto fail;
- }
- fname = resolved_fname;
- }
-
/*
* Check if POSIX semantics are wanted.
*/