While executing a setdriver-command with the rpcclient smbd got signal SIGBUS (10). This BUG is reproducible. REASON: The reason is the following cast: source/printing/printing.c at line 1211 in function print_queue_receive ctx = (struct print_queue_update_context*)buf; ctx and his members are misaligned and the next call get_printer_fns_from_type(ctx->printing_type), ctx->lpqcommand ); results in the signal SIGBUS. The construct works under Linux but never under Sparc-Solaris because structures must be 4 byte aligned. SOLUTION: --- samba-3.0.9/source/printing/printing.c.ori 2004-12-09 11:21:46.014043000 +0100 +++ samba-3.0.9/source/printing/printing.c 2004-12-09 12:10:03.946840000 +0100 @@ -1207,11 +1207,14 @@ DEBUG(1, ("Got invalid print queue update message\n")); return; } - - ctx = (struct print_queue_update_context*)buf; + ctx = (struct print_queue_update_context *)malloc(sizeof(struct print_queue_update_context)); + if(!ctx) + return; + memcpy(ctx,buf,sizeof(struct print_queue_update_context)); print_queue_update_internal(ctx->sharename, get_printer_fns_from_type(ctx->printing_type), ctx->lpqcommand ); + free(ctx); } static pid_t background_lpq_updater_pid = -1; m.f.g.
Thanks. Your patch is correct but this code has already been rewritten. See the patch posted at http://samba.org/~jerry/patches/post-3.0.9/printing-3-0-9.patch
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.