Bug 2052 - print_queue_receive(...) panics on platforms that dislike odd byte boundary
print_queue_receive(...) panics on platforms that dislike odd byte boundary
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Printing
3.0.8
All HP-UX
: P3 normal
: none
Assigned To: Gerald (Jerry) Carter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-17 16:56 UTC by David
Modified: 2005-08-24 10:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David 2004-11-17 16:56:17 UTC
The following is a diff that would solve smbd panic on HPUX.  It is an issue on 
platforms such as HPUX when buf begins in odd number of bytes.  Other 
dispatcher registered functions are fine since most of them memcpy or fstrcpy 
data out of "buf" to a local buffer.

1204c1204
<       struct print_queue_update_context *ctx;
---
>       struct print_queue_update_context ctx;
1211,1214c1211,1214
<       ctx = (struct print_queue_update_context*)buf;
<       print_queue_update_internal(ctx->sharename,
<               get_printer_fns_from_type(ctx->printing_type),
<               ctx->lpqcommand );
---
>       strncpy(&ctx, buf, len);
>       print_queue_update_internal(ctx.sharename,
>               get_printer_fns_from_type(ctx.printing_type),
>               ctx.lpqcommand );
Comment 1 Jeremy Allison 2004-11-18 15:45:51 UTC
Applied, thanks.
Jeremy.
Comment 2 Gerald (Jerry) Carter 2005-08-24 10:18:12 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.