diff options
author | Jeremy Allison <jra@samba.org> | 2007-02-08 00:14:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:49 -0500 |
commit | 778f3a00f0fef879c6332abb1c965fe745d138c5 (patch) | |
tree | 6a6686dfd89ed0b504c19f5b09e4c98a341eb10c | |
parent | ffe646b1e67bc532fd954fc84cc85d21d1f4b8f8 (diff) | |
download | samba-778f3a00f0fef879c6332abb1c965fe745d138c5.tar.gz samba-778f3a00f0fef879c6332abb1c965fe745d138c5.tar.bz2 samba-778f3a00f0fef879c6332abb1c965fe745d138c5.zip |
r21227: Quick fix for Stevef - ensure the returned data on open
is 8 byte aligned.
Jeremy.
(This used to be commit 7645044fcf77644839bb0d74163d93d03284bd67)
-rw-r--r-- | source3/include/trans2.h | 2 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 16 |
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; } |