Bug 7363 - 3.5.2: rpcclient -c setdriver fails on 64-bit hosts
Summary: 3.5.2: rpcclient -c setdriver fails on 64-bit hosts
Status: RESOLVED DUPLICATE of bug 7277
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: Printing (show other bugs)
Version: 3.5.2
Hardware: x64 Linux
: P3 normal
Target Milestone: ---
Assignee: Guenther Deschner
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-15 14:37 UTC by Steven Plite
Modified: 2010-05-10 07:20 UTC (History)
0 users

See Also:


Attachments
revert devmode_ptr and secdesc_ptr fields in spoolss_SetPrinterInfo2 (11.31 KB, patch)
2010-04-15 14:39 UTC, Steven Plite
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Plite 2010-04-15 14:37:18 UTC
"rpcclient -c setdriver blah blah" was broken for 64-bit hosts between 3.4.7 and 3.5.2.  It would fail with a DCERPC_FAULT_OP_RNG_ERROR.  (Bug #7277 may be the same issue.)

Running with "-d 255" showed the "attributes" element of the spoolss_SetPrinterInfo2 struct was being pushed down into the "priority" element, causing the range error.

cmd_spoolss_setdriver() in source3/rpcclient/cmd_spoolss.c copies and recasts a pointer to a struct spoolss_PrinterInfo2 to a struct spoolss_SetPrinterInfo2.   But in 3.5.2, the devmode and secdesc elements (pointers) of the former were changed to devmode_ptr and secdesc_ptr elements (32-bit ints) in the latter, resulting in the subsequent elements being misaligned on 64-bit hosts.

Not sure if it's the right fix, but changing devmode_ptr and secdesc_ptr back to devmode and secdesc pointers in struct spoolss_PrinterInfo2 worked for me on both 32- and 64-bit hosts.

I'll attach a patch.
Comment 1 Steven Plite 2010-04-15 14:39:25 UTC
Created attachment 5634 [details]
revert devmode_ptr and secdesc_ptr fields in spoolss_SetPrinterInfo2
Comment 2 Guenther Deschner 2010-05-10 07:20:20 UTC

*** This bug has been marked as a duplicate of bug 7277 ***