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

Re: (ITS#4697) core dump from acl.c regex




--On Wednesday, October 04, 2006 8:21 PM +0000 quanah@stanford.edu wrote:


The acl bits of "a" show:

(gdb) thread 1
[Switching to thread 1 (process 28461)]#0  0x00002b9d6dc427dd in fnmatch () 
from /lib/libc.so.6
(gdb) frame 7
#7  0x0000000000446058 in slap_access_allowed (op=0x2aaaafd40080, 
e=0x2b9e6fde1f78, desc=0x2b9d6e563d50, val=0x2aaab4e07580, access=ACL_READ, 
state=0x42e7d4e0, maskp=0x42e7d408) at acl.c:874
874                                     if ( regexec( &a->acl_attrval_re, 
val->bv_val, 0, NULL, 0 ) )
(gdb) print *a
$1 = {acl_filter = 0x0, acl_dn_style = ACL_STYLE_CHILDREN, acl_dn_re = 
{buffer = 0x0, allocated = 0, used = 0, syntax = 0, fastmap = 0x0, 
translate = 0x0, re_nsub = 0, can_be_null = 0, regs_allocated = 0, 
fastmap_accurate = 0, no_sub = 0, not_bol = 0,
    not_eol = 0, newline_anchor = 0}, acl_dn_pat = {bv_len = 18, bv_val = 
0x2b9d6e54e900 "dc=stanford,dc=edu"}, acl_attrs = 0x2b9d6e4c0080, 
acl_attrval_mr = 0x0, acl_attrval_style = ACL_STYLE_REGEX, acl_attrval_re = 
{buffer = 0x0, allocated = 0,
    used = 0, syntax = 0, fastmap = 0x0, translate = 0x0, re_nsub = 0, 
can_be_null = 0, regs_allocated = 0, fastmap_accurate = 0, no_sub = 0, 
not_bol = 0, not_eol = 0, newline_anchor = 0}, acl_attrval = {bv_len = 0, 
bv_val = 0x0},
  acl_access = 0x2b9d6e969ae0, acl_next = 0x2b9d6e9455c0}



It seems we should have never gotten to this section of the code:

(gdb) l
855                     /* Is this ACL only for a specific value? */
856                     if ( a->acl_attrval.bv_len ) {
857                             if ( val == NULL ) {
858                                     continue;
859                             }
860
861                             if( state && !( state->as_recorded & 
ACL_STATE_RECORDED_VD )) {
862                                     state->as_recorded |= 
ACL_STATE_RECORDED_VD;
863                                     state->as_vd_acl = a;
864                                     state->as_vd_acl_count = *count;
865                                     state->as_vd_access = a->acl_access;
866                                     state->as_vd_access_count = 1;
867                                     ACL_INVALIDATE( 
state->as_vd_acl_mask );
868                             }
869
870                             if ( a->acl_attrval_style == 
ACL_STYLE_REGEX ) {
871                                     Debug( LDAP_DEBUG_ACL,
872                                             "acl_get: valpat %s\n",
873                                             a->acl_attrval.bv_val, 0, 0 
);
874                                     if ( regexec( &a->acl_attrval_re, 
val->bv_val, 0, NULL, 0 ) )



Since a->acl_attrval.bv_len is 0.  At the moment, Howard and I blame the 
compiler (gcc 3.4)


--Quanah



--
Quanah Gibson-Mount
Principal Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html