[Samba] Printing eats my CPU

Gerald Carter jerry at samba.org
Mon Jul 29 10:24:38 GMT 2002

On Mon, 29 Jul 2002, Franz Sirl wrote:

> At 14:49 29.07.2002, Gerald Carter wrote:
> >On Mon, 29 Jul 2002, Franz Sirl wrote:
> >
> > > Franz.
> > >
> > >          * rpc_server/srv_spoolss_nt.c (_spoolss_enumprinterdataex): Don't
> > > try to allocate 0 bytes.
> >
> >Actulayy...try this patch (modified your original one a little
> >to make sure the pointer was NULL if no memory was allocated).
> Your patch works equally well here.
> >I'm not sure, but I have a gut feeling the marshalling routine
> >may need to be modified to deal with data of length 0.   But I
> >really need to see a trace from 2k -> 2k for this.  I'll leave it
> >alone for now.
> The code in convert_specific_param() handles the length in the same way, so 
> I thought it's safe.

I was looking at the code which marshalls the printer data onto the 
wire and it looks like there might be some overlapping offsets if tge 
data_len == 0.  I'll have to experiement some more to be absolutely
certain.  But if it is working for you now, then cool :-)

cheers, jerry
 Hewlett-Packard                                     http://www.hp.com
 SAMBA Team                                       http://www.samba.org
 --                                            http://www.plainjoe.org
 "Sam's Teach Yourself Samba in 24 Hours" 2ed.      ISBN 0-672-32269-2
 --"I never saved anything for the swim back." Ethan Hawk in Gattaca--

More information about the samba mailing list