diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-02 12:16:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:32 -0500 |
commit | a46270e2fa2812411f65136f36cc4bb3005b9c30 (patch) | |
tree | 683e61b5a437c68b3936d1194da4b1439c23b0ec /source4 | |
parent | 20c550d87fae703dd8b84cb8f97c3bd32054d35a (diff) | |
download | samba-a46270e2fa2812411f65136f36cc4bb3005b9c30.tar.gz samba-a46270e2fa2812411f65136f36cc4bb3005b9c30.tar.bz2 samba-a46270e2fa2812411f65136f36cc4bb3005b9c30.zip |
r2784: - fixed alignment of ascii directory listings
- fixed minimum parameter size for ascii qpathinfo call
(This used to be commit ee065ae7f92e60600966cb1d44cd0e30498b93dd)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/smb_server/trans2.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source4/smb_server/trans2.c b/source4/smb_server/trans2.c index b8b3035286..7954673a64 100644 --- a/source4/smb_server/trans2.c +++ b/source4/smb_server/trans2.c @@ -192,6 +192,18 @@ static void trans2_append_data_string(struct smbsrv_request *req, trans2_grow_data(req, trans, offset + ret); } +/* + align the end of the data section of a trans reply on an even boundary +*/ +static void trans2_align_data(struct smbsrv_request *req, struct smb_trans2 *trans) +{ + if ((trans->out.data.length & 1) == 0) { + return; + } + trans2_grow_data(req, trans, trans->out.data.length+1); + SCVAL(trans->out.data.data, trans->out.data.length-1, 0); +} + /* trans2 qfsinfo implementation @@ -623,7 +635,7 @@ static NTSTATUS trans2_qpathinfo(struct smbsrv_request *req, struct smb_trans2 * uint16_t level; /* make sure we got enough parameters */ - if (trans->in.params.length < 8) { + if (trans->in.params.length < 2) { return NT_STATUS_FOOBAR; } @@ -997,6 +1009,7 @@ static void find_fill_info(struct smbsrv_request *req, 24, STR_UNICODE | STR_LEN8BIT); trans2_append_data_string(req, trans, &file->both_directory_info.name, ofs + 60, STR_TERMINATE_ASCII); + trans2_align_data(req, trans); data = trans->out.data.data + ofs; SIVAL(data, 0, trans->out.data.length - ofs); break; |