summaryrefslogtreecommitdiff
path: root/source3/smbd/aio.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-19 20:50:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:30 -0500
commitdc90cd89a7fef3b0a744ef1873193cf2c9d75cad (patch)
tree33829db8298e704caba2679aa27d3ff99bf411a2 /source3/smbd/aio.c
parent20086f66cc32951da69aa357bc19c14d31a3913a (diff)
downloadsamba-dc90cd89a7fef3b0a744ef1873193cf2c9d75cad.tar.gz
samba-dc90cd89a7fef3b0a744ef1873193cf2c9d75cad.tar.bz2
samba-dc90cd89a7fef3b0a744ef1873193cf2c9d75cad.zip
r22389: Start preparing for multiple encryption contexts in the
server. Allow server to reflect back to calling client the encryption context that was sent. Jeremy. (This used to be commit b49e90335d1e589916b5ab4992e3c4a2d221ca7e)
Diffstat (limited to 'source3/smbd/aio.c')
-rw-r--r--source3/smbd/aio.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index a85cf901ae..6b403e1e36 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -49,8 +49,10 @@ static struct aio_extra *aio_list_head;
of the aio_read call.
*****************************************************************************/
-static struct aio_extra *create_aio_ex_read(files_struct *fsp, size_t buflen,
- uint16 mid)
+static struct aio_extra *create_aio_ex_read(files_struct *fsp,
+ size_t buflen,
+ uint16 mid,
+ const char *inbuf)
{
struct aio_extra *aio_ex = SMB_MALLOC_P(struct aio_extra);
@@ -66,6 +68,14 @@ static struct aio_extra *create_aio_ex_read(files_struct *fsp, size_t buflen,
SAFE_FREE(aio_ex);
return NULL;
}
+ /* Save the first 8 bytes of inbuf for possible enc data. */
+ aio_ex->inbuf = SMB_MALLOC_ARRAY(char, 8);
+ if (!aio_ex->inbuf) {
+ SAFE_FREE(aio_ex->outbuf);
+ SAFE_FREE(aio_ex);
+ return NULL;
+ }
+ memcpy(aio_ex->inbuf, inbuf, 8);
DLIST_ADD(aio_list_head, aio_ex);
aio_ex->fsp = fsp;
aio_ex->read_req = True;
@@ -408,7 +418,7 @@ static int handle_aio_read_complete(struct aio_extra *aio_ex)
aio_ex->acb.aio_nbytes, (int)nread ) );
}
- smb_setlen(outbuf,outsize - 4);
+ smb_setlen(outbuf,outsize - 4,aio_ex->inbuf);
show_msg(outbuf);
if (!send_smb(smbd_server_fd(),outbuf)) {
exit_server_cleanly("handle_aio_read_complete: send_smb "