Bug 2052 - print_queue_receive(...) panics on platforms that dislike odd byte boundary
Summary: print_queue_receive(...) panics on platforms that dislike odd byte boundary
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Printing (show other bugs)
Version: 3.0.8
Hardware: All HP-UX
: P3 normal
Target Milestone: none
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
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 (dead mail address) 2005-08-24 10:18:12 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.