diff options
author | Steven Danneman <steven.danneman@isilon.com> | 2010-06-28 16:06:33 -0700 |
---|---|---|
committer | Steven Danneman <steven.danneman@isilon.com> | 2010-07-06 13:28:02 -0700 |
commit | 85504ae6ff72204894ea7a856f0f36b44ad77fe2 (patch) | |
tree | 57b87f35b681959073f432d4b402d01d12a48111 /source4/libcli/raw | |
parent | 00056e73c1cb54f5d6c10e63b70afc2c84e5883e (diff) | |
download | samba-85504ae6ff72204894ea7a856f0f36b44ad77fe2.tar.gz samba-85504ae6ff72204894ea7a856f0f36b44ad77fe2.tar.bz2 samba-85504ae6ff72204894ea7a856f0f36b44ad77fe2.zip |
s4:libcli: Modify S4 client library to check for proper CN alignment
MS-CIFS 2.2.7.4.2 states that FILE_NOTIFY_INFORMATION structures in
change notify replies must be aligned to 4-byte boundaries.
This updates s4 client to check for this restriction and also adds a
torture test which should tickle a server into giving unaligned
structures if it doesn't follow the spec.
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/rawnotify.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/libcli/raw/rawnotify.c b/source4/libcli/raw/rawnotify.c index 2155076dd7..40256aa405 100644 --- a/source4/libcli/raw/rawnotify.c +++ b/source4/libcli/raw/rawnotify.c @@ -71,10 +71,12 @@ _PUBLIC_ NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req, parms->nttrans.out.changes = NULL; parms->nttrans.out.num_changes = 0; - + /* count them */ for (ofs=0; nt.out.params.length - ofs > 12; ) { uint32_t next = IVAL(nt.out.params.data, ofs); + if (next % 4 != 0) + return NT_STATUS_INVALID_NETWORK_RESPONSE; parms->nttrans.out.num_changes++; if (next == 0 || ofs + next >= nt.out.params.length) break; |