Re: ptloader segfaulting while looking up LDAP groups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Igor Brezac <igor@xxxxxxxxx> [20060809 11:50]:
> 
> 
> On Wed, 9 Aug 2006, Ben Poliakoff wrote:
> 
> >* Igor Brezac <igor@xxxxxxxxx> [20060809 07:39]:
> >>
> >>
> >>On Tue, 8 Aug 2006, Ben Poliakoff wrote:
> >>
> >>>ptloader is segfaulting on multiple servers in my test environment when
> >>>the user that is connecting for IMAP service is found in more than one
> >>>group.
> >>>
> >>>I have a core file, but it doesn't seem that useful since a number of
> >>>the libraries that ptloader links to don't currently have debugging
> >>>symbols...
> >>
> >>Can you provide backtrace?
> >>
> >
> >Yes, here's a backtrace...
> >
> >Core was generated by `ptloader'.
> >Program terminated with signal 11, Segmentation fault.
> >...
> >#0  0x00002b180d157c00 in strlen () from /lib/libc.so.6
> >(gdb) bt
> >#0  0x00002b180d157c00 in strlen () from /lib/libc.so.6
> >#1  0x00000000004079f7 in ptsmodule_make_authstate_filter (canon_id=0x0,
> >   size=0, reply=0x6e, dsize=0x1, newstate=0x7fff9e958860) at
> >ldap.c:1070
> >#2  0x0000000000407de6 in myauthstate (identifier=0x0, size=4,
> >   reply=0x7fff9e9588d8, dsize=0x7fff9e9588e4) at ldap.c:1217
> >#3  0x000000000040590a in ptsmodule_make_authstate (
> >   identifier=0x7fff9e9588f0 "benp", size=4, reply=0x7fff9e9588d8,
> >   dsize=0x7fff9e9588e4) at ptloader.c:120
> >#4  0x0000000000405b60 in service_main_fd (c=7, argc=4, argv=0x5db69c,
> >   envp=0x0) at ptloader.c:235
> >#5  0x000000000040821a in main (argc=6099056, argv=0x7fff9e959258,
> >   envp=0x7fff9e959268) at service-thread.c:304
> >
> >Ben
> >
> 
> The last commit has an issue.
> 
> Please try this patch and report back:
> 
> --- ldap.c.orig	2006-08-09 14:42:05.023665000 -0400
> +++ ldap.c	2006-08-09 14:42:41.274455000 -0400
> @@ -1065,11 +1065,11 @@
>                  continue;
> 
>              strcpy((*newstate)->groups[i].id, "group:");
> +
>  	    int j;
> -	    strcpy((*newstate)->groups[i].id, "group:");
> -	    for(j =0; j < strlen(vals[i]); j++) {
> -	      if(isupper(vals[i][j]))
> -		vals[i][j]=tolower(vals[i][j]);
> +	    for(j =0; j < strlen(vals[0]); j++) {
> +	      if(isupper(vals[0][j]))
> +		vals[0][j]=tolower(vals[0][j]);
>  	    }
> 
>              strlcat((*newstate)->groups[i].id, vals[0],
> 

Yes, this patch fixes the problem.  Thanks so much for your help!

Ben
----
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux