summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/trans2.h2
-rw-r--r--source3/smbd/trans2.c16
2 files changed, 12 insertions, 6 deletions
diff --git a/source3/include/trans2.h b/source3/include/trans2.h
index 5a3b25de4d..fb8e7716ab 100644
--- a/source3/include/trans2.h
+++ b/source3/include/trans2.h
@@ -394,6 +394,8 @@ Offset Size Name
100 - end.
*/
+#define SMB_FILE_UNIX_BASIC_SIZE 100
+
/* UNIX filetype mappings. */
#define UNIX_TYPE_FILE 0
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 66f16a52bb..bab94b1c7d 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4914,9 +4914,9 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
info_level_return = SVAL(pdata,12);
if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) {
- *pdata_return_size = 6;
+ *pdata_return_size = 8 + SMB_FILE_UNIX_BASIC_SIZE;
} else {
- *pdata_return_size = 6;
+ *pdata_return_size = 8;
}
/* Realloc the data size */
@@ -4931,9 +4931,11 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) {
SSVAL(pdata,4,SMB_QUERY_FILE_UNIX_BASIC);
- store_file_unix_basic(pdata + 6, fsp, psbuf);
+ SSVAL(pdata,6,0); /* Padding. */
+ store_file_unix_basic(pdata + 8, fsp, psbuf);
} else {
SSVAL(pdata,4,SMB_NO_INFO_LEVEL_RETURNED);
+ SSVAL(pdata,6,0); /* Padding. */
}
return status;
@@ -5067,9 +5069,9 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
info_level_return = SVAL(pdata,12);
if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) {
- *pdata_return_size = 6;
+ *pdata_return_size = 8 + SMB_FILE_UNIX_BASIC_SIZE;
} else {
- *pdata_return_size = 6;
+ *pdata_return_size = 8;
}
/* Realloc the data size */
@@ -5095,9 +5097,11 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
SSVAL(pdata,2,fsp->fnum);
if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) {
SSVAL(pdata,4,SMB_QUERY_FILE_UNIX_BASIC);
- store_file_unix_basic(pdata + 6, fsp, psbuf);
+ SSVAL(pdata,6,0); /* padding. */
+ store_file_unix_basic(pdata + 8, fsp, psbuf);
} else {
SSVAL(pdata,4,SMB_NO_INFO_LEVEL_RETURNED);
+ SSVAL(pdata,6,0); /* padding. */
}
return NT_STATUS_OK;
}