[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Shell backend: read_and_send_results



On Wed, Apr 19, 2006 at 09:34:19PM +0200, Hallvard B Furuseth wrote:
> Timur Izhbulatov writes:
> 
> > After some investigation it appeared that the problem is in the way
> > how the str2result function (servers/slapd/result.c) works. It uses
> > the luitl_atoix function (libraries/libutil/utils.c) in which:
> >
> >         i = strtol( s, &next, x );
> >         if ( next == s || next[ 0 ] != '\0' ) {
> >                 return -1;
> >         }
> >
> > If "code: <integer>" is the second line, as the man page says, next[ 0
> > ] contains '\n' (the first non-digit character after the integer) and
> > lutil_atoix fails to convert the code value. That is why it fails if
> > there are any trailing characters after the value.
> 
> You are right.  That was introduced in servers/slapd/result.c rev 1.276.
> Replace
> 			if ( c != NULL && lutil_atoi( code, c ) != 0 ) {
> 				goto bailout;
> with the previous code
> 			if ( c != NULL ) {
> 				*code = atoi( c );
> and it should work.
> 
> And I figured out the weird "space instead of newline" in the log which
> originally confused us: It's syslog which does the substitution.  I was
> looking at the 'slap -d shell' output instead:-( Sorry about sending you
> off with an error report in the wrong direction.
> 
> Which leaves one problem: The current (broken) code should have returned
> an error for me.  Maybe one bug hid another.  I'll check later.

OK, good.

So what's the plan now? We are open for further cooperation and finally we would
be happy to have that fixed in trunk.

Cheers,

-- 
Timur Izhbulatov
OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia
P:+7 495 105 7245 + ext.205 F:+7 495 105 7246 E:TimurIzhbulatov@oilspace.com
Building Successful Supply Chains - One Solution At A Time.
www.oilspace.com