patch for pdb_ldap.c (1.1.2.36)

Simo Sorce idra at samba.org
Fri Jul 5 04:35:02 GMT 2002


On Fri, 2002-07-05 at 11:38, Markus Schabel wrote:
> Yes, my fault. I thought the len is for parameter #3, but it actually is for
> parameter #5 (start counting with 1)
> so for example strlen(homedir) instead of sizeof(homedir) should work? At least
> I'll try this...

Markus, it really depends.
You do not want to put strlen(string) as you would have absolutely no
room for expansion.

Using pstrings, fixed size (1024) strings, you can easily put
sizeof(pstring) (==1024) and you have room to grow until 1024 bytes.

Instead when we change to allocated strings, we are forced to make a new
set of substitution functions that will realloc strings as needed.

I will take the issue to do that asap, as I'm a strong supporter of
allocated strings against pstrings.

I will code up in days (if I have time of course) a series of
alloc_substitute...() functions that will acccept a string in input and
return a new allocated string as output.

Simo. 

-- 
Simo Sorce
----------
Una scelta di liberta': Software Libero.
A choice of freedom: Free Software.
http://www.softwarelibero.it




More information about the samba-technical mailing list