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

Re: Modify with NULLs causes an assertion to fail, slapd to abort (ITS#1364)



At 01:26 PM 2001-10-02, jmadden@ivy.tec.in.us wrote:
>Full_Name: John Madden
>Version: 2.0.14
>OS: Solaris 8
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (168.91.4.66)
>
>
>Using perl's Net::LDAP (for example), it is possible to cause slapd to exit on
>the assert call in servers/slapd/schema_check.c line 45 -- by sending a NULL
>value.  
>
>Example LDIF prior to the modify:
>
>dn: uid=jmadden,ou=People,dc=ivy,dc=tec,dc=in,dc=us
>objectClass: account
>objectClass: posixAccount
>objectClass: top
>objectClass: shadowAccount
>uid: jmadden
>cn: jmadden
>gidNumber: 100
>uidNumber: 10042
>homeDirectory: /home/jmadden
>mainframeId: ycn000
>loginShell: /bin/bash
>gecos: John E. Madden,, 921-4691
>mailacceptinggeneralid:
>maildrop: jmadden
>description: Unix Systems Engineer
>campus: Central Office
>
>Sample perl code to cause the assert() to fail:
>
>$result = $ldap->modify(
>  "uid=$uid,ou=People,dc=ivy,dc=tec,dc=in,dc=us",
>  changes => 
>  [
>   replace => [ 'gecos', "$in{'name'},, $in{'phone'}",
>   'mailacceptinggeneralid', "$in{'alias'}",
>   'maildrop', "$uid",
>   'description', "$in{'title'}",
>   'campus', "$in{'campus'}"
>   ]
>  ] 
>);

I note that net::ldap provides facilities to generate a
hex dump of LDAP requests it generates.  This can be provided
in lieu of the LDIF or ber_dump of the message.

>Logging: 
>/usr/local/libexec/slapd -d 816

No TRACE or ARGS, ugh... (see below).

>ber_dump: buf=0x001025d0 ptr=0x00102674 end=0x001026a1 len=45
>  0000:  30 2b 0a 01 02 30 26 04  0b 64 65 73 63 72 69 70   0+...0&..descrip  
>  0010:  74 69 6f 6e 31 17 04 15  55 6e 69 78 20 53 79 73   tion1...Unix Sys  
>  0020:  74 65 6d 73 20 45 6e 67  69 6e 65 65 72            tems Engineer     

This appears to be the BER for the last replace part of the
modify request.  Above this you should be able to find
ber_dump messages containing the most of LDAP message.  You
should be able to see the characters making up the DN in
the right hand column.  Normally, you'd just look for the ber_dump
just below the TRACE message:
  do_modify
or just above the ARGS message:
  do_modify: dn (uid=jmadden,ou=People,dc=ivy,dc=tec,dc=in,dc=us)
  
But since you used -d 816, so won't have these.  So, you'll have
to dig for ber_dump containing the LDAP message.  You should
be able to page up until you find a ber_dump containing the DN.


>conn=5 op=1 MOD dn="uid=jmadden,ou=People,dc=ivy,dc=tec,dc=in,dc=us"
>schema_check.c:45: failed assertion `a->a_vals[0] != NULL'
>Abort
>
>Please feel free to contact me if more information is necessary.

I think in this case, I'm going to need more complete BER dump
to determine exactly what the client request was.  Please provide
if at all possible.