summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-09-24 17:36:24 -0700
committerAndrew Tridgell <tridge@samba.org>2008-09-24 18:10:23 -0700
commit742a99e046313760a281da67eb3ba6e7fcfa8fa6 (patch)
tree85e2ac21cf0e5bb806c2b52e670d5fb1581cf428
parent63685c7d02f2364344fd8d4a3307ee36716e4a66 (diff)
downloadsamba-742a99e046313760a281da67eb3ba6e7fcfa8fa6.tar.gz
samba-742a99e046313760a281da67eb3ba6e7fcfa8fa6.tar.bz2
samba-742a99e046313760a281da67eb3ba6e7fcfa8fa6.zip
- add reserved field in basic_information level
- use INVALID_PARAMETER for info length mismatch to match windows behaviour - added parsing of LINK_INFORMATION level
-rw-r--r--source4/smb_server/blob.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/source4/smb_server/blob.c b/source4/smb_server/blob.c
index 368b81d18e..4f018a5143 100644
--- a/source4/smb_server/blob.c
+++ b/source4/smb_server/blob.c
@@ -35,7 +35,7 @@
#define BLOB_CHECK_MIN_SIZE(blob, size) do { \
if ((blob)->length < (size)) { \
- return NT_STATUS_INFO_LENGTH_MISMATCH; \
+ return NT_STATUS_INVALID_PARAMETER; \
} \
} while (0)
@@ -530,13 +530,14 @@ NTSTATUS smbsrv_pull_passthru_sfileinfo(TALLOC_CTX *mem_ctx,
switch (level) {
case SMB_SFILEINFO_BASIC_INFORMATION:
- BLOB_CHECK_MIN_SIZE(blob, 36);
+ BLOB_CHECK_MIN_SIZE(blob, 40);
st->basic_info.in.create_time = pull_nttime(blob->data, 0);
st->basic_info.in.access_time = pull_nttime(blob->data, 8);
st->basic_info.in.write_time = pull_nttime(blob->data, 16);
st->basic_info.in.change_time = pull_nttime(blob->data, 24);
- st->basic_info.in.attrib = IVAL(blob->data, 32);
+ st->basic_info.in.attrib = IVAL(blob->data, 32);
+ st->basic_info.in.reserved = IVAL(blob->data, 36);
return NT_STATUS_OK;
@@ -581,6 +582,27 @@ NTSTATUS smbsrv_pull_passthru_sfileinfo(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
+
+ case RAW_SFILEINFO_LINK_INFORMATION:
+ if (!bufinfo) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+ BLOB_CHECK_MIN_SIZE(blob, 20);
+ st->link_information.in.overwrite = CVAL(blob->data, 0);
+ st->link_information.in.root_fid = IVAL(blob->data, 8);
+ len = IVAL(blob->data, 16);
+ ofs = 20;
+ str_blob = *blob;
+ str_blob.length = MIN(str_blob.length, ofs+len);
+ smbsrv_blob_pull_string(bufinfo, &str_blob, ofs,
+ &st->link_information.in.new_name,
+ STR_UNICODE);
+ if (st->link_information.in.new_name == NULL) {
+ return NT_STATUS_FOOBAR;
+ }
+
+ return NT_STATUS_OK;
+
case RAW_SFILEINFO_RENAME_INFORMATION_SMB2:
/* SMB2 uses a different format for rename information */
if (!bufinfo) {