diff options
author | Gerald Carter <jerry@samba.org> | 2007-04-09 16:04:07 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2007-04-09 16:04:07 +0000 |
commit | 7dcb89c1236f9712f9018744bea2e016b5cdfab9 (patch) | |
tree | 69b6dd928b31818c82a7368be3cff169cc8b8a61 /source/rpc_parse/parse_spoolss.c | |
parent | 099d375891d4444320bd451486e8bf7d9afdbe0f (diff) | |
download | samba-7dcb89c1236f9712f9018744bea2e016b5cdfab9.tar.gz samba-7dcb89c1236f9712f9018744bea2e016b5cdfab9.tar.xz samba-7dcb89c1236f9712f9018744bea2e016b5cdfab9.zip |
r22138: * Sync up with the SAMBA_3_0_25 as of svn r22132.
* Set VERSION to 3.0.25rc1
* Update release notes.
Diffstat (limited to 'source/rpc_parse/parse_spoolss.c')
-rw-r--r-- | source/rpc_parse/parse_spoolss.c | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c index 90c47950af7..57899ceff30 100644 --- a/source/rpc_parse/parse_spoolss.c +++ b/source/rpc_parse/parse_spoolss.c @@ -2388,6 +2388,7 @@ BOOL smb_io_printer_info_2(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_2 BOOL smb_io_printer_info_3(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_3 *info, int depth) { + uint32 offset = 0; prs_struct *ps=&buffer->prs; prs_debug(ps, depth, desc, "smb_io_printer_info_3"); @@ -2395,8 +2396,41 @@ BOOL smb_io_printer_info_3(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_3 buffer->struct_start=prs_offset(ps); - if (!prs_uint32("flags", ps, depth, &info->flags)) - return False; + if (MARSHALLING(ps)) { + /* Ensure the SD is 8 byte aligned in the buffer. */ + uint start = prs_offset(ps); /* Remember the start position. */ + uint off_val = 0; + + /* Write a dummy value. */ + if (!prs_uint32("offset", ps, depth, &off_val)) + return False; + + /* 8 byte align. */ + if (!prs_align_uint64(ps)) + return False; + + /* Remember where we must seek back to write the SD. */ + offset = prs_offset(ps); + + /* Calculate the real offset for the SD. */ + + off_val = offset - start; + + /* Seek back to where we store the SD offset & store. */ + prs_set_offset(ps, start); + if (!prs_uint32("offset", ps, depth, &off_val)) + return False; + + /* Return to after the 8 byte align. */ + prs_set_offset(ps, offset); + + } else { + if (!prs_uint32("offset", ps, depth, &offset)) + return False; + /* Seek within the buffer. */ + if (!prs_set_offset(ps, offset)) + return False; + } if (!sec_io_desc("sec_desc", &info->secdesc, ps, depth)) return False; @@ -3143,9 +3177,8 @@ return the size required by a struct in the stream uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info) { - /* The 4 is for the self relative pointer.. */ - /* JRA !!!! TESTME - WHAT ABOUT prs_align.... !!! */ - return 4 + (uint32)sec_desc_size( info->secdesc ); + /* The 8 is for the self relative pointer - 8 byte aligned.. */ + return 8 + (uint32)sec_desc_size( info->secdesc ); } /******************************************************************* |