[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-863-g2a47456

Andrew Tridgell tridge at samba.org
Mon Feb 18 03:56:48 GMT 2008


The branch, v4-0-test has been updated
       via  2a474568c2f85603657a97ad658089122a1f4f19 (commit)
       via  a29dd708bf26440552ffa9d83332329b4c108857 (commit)
       via  cf109460aff5a8437ab7eba05e4d7316a131080e (commit)
       via  66d0502228b31533b5d93731128a681992c22eda (commit)
      from  3c9973b695a0b5c30d3a5bfabecf62dd1a25ebc1 (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 2a474568c2f85603657a97ad658089122a1f4f19
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon Feb 18 14:55:30 2008 +1100

    disable the EAS level in SMB2-GETINFO test until we get some feedback
    on how the alignment requirements have changed

commit a29dd708bf26440552ffa9d83332329b4c108857
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon Feb 18 14:54:59 2008 +1100

    open a root handle in SMB2 should use a NULL filename, not a zero length
    filename

commit cf109460aff5a8437ab7eba05e4d7316a131080e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon Feb 18 14:54:14 2008 +1100

    3 places where the VFS backend doesn't handle NULL strings.

commit 66d0502228b31533b5d93731128a681992c22eda
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon Feb 18 14:53:48 2008 +1100

    handle pushing of zero length smb2 strings

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

Summary of changes:
 source/libcli/smb2/request.c    |    6 ++++++
 source/smb_server/smb2/fileio.c |    5 +++++
 source/smb_server/smb2/find.c   |    5 +++++
 source/smb_server/smb2/tcon.c   |    5 +++++
 source/torture/smb2/getinfo.c   |   10 ++++++----
 source/torture/smb2/util.c      |    3 ++-
 6 files changed, 29 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libcli/smb2/request.c b/source/libcli/smb2/request.c
index 1de0531..2471fca 100644
--- a/source/libcli/smb2/request.c
+++ b/source/libcli/smb2/request.c
@@ -668,6 +668,12 @@ NTSTATUS smb2_push_o16s16_string(struct smb2_request_buffer *buf,
 		return smb2_push_o16s16_blob(buf, ofs, data_blob(NULL, 0));
 	}
 
+	if (*str == 0) {
+		blob.data = str;
+		blob.length = 0;
+		return smb2_push_o16s16_blob(buf, ofs, blob);
+	}
+
 	size = convert_string_talloc(buf->buffer, lp_iconv_convenience(global_loadparm), CH_UNIX, CH_UTF16, 
 				     str, strlen(str), (void **)&blob.data);
 	if (size == -1) {
diff --git a/source/smb_server/smb2/fileio.c b/source/smb_server/smb2/fileio.c
index 567243b..0e3df56 100644
--- a/source/smb_server/smb2/fileio.c
+++ b/source/smb_server/smb2/fileio.c
@@ -80,6 +80,11 @@ void smb2srv_create_recv(struct smb2srv_request *req)
 	/* TODO: parse the blob */
 	ZERO_STRUCT(io->smb2.in.eas);
 
+	/* the VFS backend does not yet handle NULL filenames */
+	if (io->smb2.in.fname == NULL) {
+		io->smb2.in.fname = "";
+	}
+
 	SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_open(req->ntvfs, io));
 }
 
diff --git a/source/smb_server/smb2/find.c b/source/smb_server/smb2/find.c
index c594adf..6018f19 100644
--- a/source/smb_server/smb2/find.c
+++ b/source/smb_server/smb2/find.c
@@ -161,6 +161,11 @@ void smb2srv_find_recv(struct smb2srv_request *req)
 	SMB2SRV_CHECK(smb2_pull_o16s16_string(&req->in, info, req->in.body+0x18, &info->in.pattern));
 	info->in.max_response_size	= IVAL(req->in.body, 0x1C);
 
+	/* the VFS backend does not yet handle NULL patterns */
+	if (info->in.pattern == NULL) {
+		info->in.pattern = "";
+	}
+
 	SMB2SRV_CHECK_FILE_HANDLE(info->in.file.ntvfs);
 	SMB2SRV_CALL_NTVFS_BACKEND(smb2srv_find_backend(state));
 }
diff --git a/source/smb_server/smb2/tcon.c b/source/smb_server/smb2/tcon.c
index 50094b8..7f7d558 100644
--- a/source/smb_server/smb2/tcon.c
+++ b/source/smb_server/smb2/tcon.c
@@ -394,6 +394,11 @@ void smb2srv_tcon_recv(struct smb2srv_request *req)
 	io->smb2.in.reserved	= SVAL(req->in.body, 0x02);
 	SMB2SRV_CHECK(smb2_pull_o16s16_string(&req->in, io, req->in.body+0x04, &io->smb2.in.path));
 
+	/* the VFS backend does not yet handle NULL paths */
+	if (io->smb2.in.path == NULL) {
+		io->smb2.in.path = "";
+	}
+
 	req->status = smb2srv_tcon_backend(req, io);
 
 	if (req->control_flags & SMB2SRV_REQ_CTRL_FLAG_NOT_REPLY) {
diff --git a/source/torture/smb2/getinfo.c b/source/torture/smb2/getinfo.c
index f561b62..c47a262 100644
--- a/source/torture/smb2/getinfo.c
+++ b/source/torture/smb2/getinfo.c
@@ -51,7 +51,9 @@ static struct {
  { LEVEL(RAW_FILEINFO_COMPRESSION_INFORMATION) },
  { LEVEL(RAW_FILEINFO_NETWORK_OPEN_INFORMATION) },
  { LEVEL(RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION) },
- { LEVEL(RAW_FILEINFO_SMB2_ALL_EAS) },
+/*  
+disabled until we know how the alignment now works
+{ LEVEL(RAW_FILEINFO_SMB2_ALL_EAS) }, */
  { LEVEL(RAW_FILEINFO_SMB2_ALL_INFORMATION) },
  { LEVEL(RAW_FILEINFO_SEC_DESC) }
 };
@@ -85,13 +87,13 @@ static bool torture_smb2_fileinfo(struct torture_context *tctx, struct smb2_tree
 
 	status = torture_smb2_testfile(tree, FNAME, &hfile);
 	if (!NT_STATUS_IS_OK(status)) {
-		printf("Unable to create test file '%s' - %s\n", FNAME, nt_errstr(status));
+		printf(__location__ " Unable to create test file '%s' - %s\n", FNAME, nt_errstr(status));
 		goto failed;
 	}
 
 	status = torture_smb2_testdir(tree, DNAME, &hdir);
 	if (!NT_STATUS_IS_OK(status)) {
-		printf("Unable to create test directory '%s' - %s\n", DNAME, nt_errstr(status));
+		printf(__location__ " Unable to create test directory '%s' - %s\n", DNAME, nt_errstr(status));
 		goto failed;
 	}
 
@@ -150,7 +152,7 @@ static bool torture_smb2_fsinfo(struct smb2_tree *tree)
 	printf("Testing fsinfo levels\n");
 	status = smb2_util_roothandle(tree, &handle);
 	if (!NT_STATUS_IS_OK(status)) {
-		printf("Unable to create test directory '%s' - %s\n", DNAME, nt_errstr(status));
+		printf(__location__ " Unable to create root handle - %s\n", nt_errstr(status));
 		return false;
 	}
 
diff --git a/source/torture/smb2/util.c b/source/torture/smb2/util.c
index 219c214..f85b1c4 100644
--- a/source/torture/smb2/util.c
+++ b/source/torture/smb2/util.c
@@ -123,6 +123,7 @@ static NTSTATUS smb2_create_complex(struct smb2_tree *tree, const char *fname,
 		io.in.create_disposition = NTCREATEX_DISP_CREATE;
 	}
 
+	/* it seems vista is now fussier about alignment? */
 	if (strchr(fname, ':') == NULL) {
 		/* setup some EAs */
 		io.in.eas.num_eas = 2;
@@ -428,7 +429,7 @@ NTSTATUS smb2_util_roothandle(struct smb2_tree *tree, struct smb2_handle *handle
 	io.in.create_disposition = NTCREATEX_DISP_OPEN;
 	io.in.share_access = NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_DELETE;
 	io.in.create_options = NTCREATEX_OPTIONS_ASYNC_ALERT;
-	io.in.fname = "";
+	io.in.fname = NULL;
 
 	status = smb2_create(tree, tree, &io);
 	NT_STATUS_NOT_OK_RETURN(status);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list