diff options
author | Jeremy Allison <jra@samba.org> | 2005-05-18 18:02:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:56:56 -0500 |
commit | fe0ce8dd8e18de6110404661f26db7a66ebac5ad (patch) | |
tree | fdc3855c259384f7773d3e6d9054b282d81a8553 /source3/rpc_server | |
parent | 3b0df6770db55a7690473547bef29a5a7bede0b9 (diff) | |
download | samba-fe0ce8dd8e18de6110404661f26db7a66ebac5ad.tar.gz samba-fe0ce8dd8e18de6110404661f26db7a66ebac5ad.tar.bz2 samba-fe0ce8dd8e18de6110404661f26db7a66ebac5ad.zip |
r6890: Refactor printing interface to take offset into job. Fixes bug
where large print jobs can have out-of-order offsets. Bug found
by Arcady Chernyak <Arcady.Chernyak@efi.com>
Jeremy.
(This used to be commit 482f7e0e3706098b71aa0b31a134994acb1e9fcf)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 7daf1630fe..b7091b2ade 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -5798,8 +5798,9 @@ WERROR _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R if (!get_printer_snum(p, handle, &snum)) return WERR_BADFID; - (*buffer_written) = print_job_write(snum, Printer->jobid, (char *)buffer, buffer_size); - if (*buffer_written == -1) { + (*buffer_written) = (uint32)print_job_write(snum, Printer->jobid, (const char *)buffer, + (SMB_OFF_T)-1, (size_t)buffer_size); + if (*buffer_written == (uint32)-1) { r_u->buffer_written = 0; if (errno == ENOSPC) return WERR_NO_SPOOL_SPACE; |