X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-passwd%2Fsearch.c;h=6a4258ab2c1e8eaabd4d50a110e53e06393e5a02;hb=001f14965402aa86f3d7cd364fc781caeb603719;hp=76386d756b0d415c524ce8a15cc49e24a2d1bdb0;hpb=f07015dad2d6ccdbe5b8360bfbc601b13baae894;p=openldap diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index 76386d756b..6a4258ab2c 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2005 The OpenLDAP Foundation. + * Copyright 1998-2011 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,7 +59,7 @@ passwd_back_search( SlapReply *rs ) { struct passwd *pw; - time_t stoptime; + time_t stoptime = (time_t)-1; LDAPRDN rdn = NULL; struct berval parent = BER_BVNULL; @@ -123,6 +123,8 @@ passwd_back_search( rs->sr_attrs = op->ors_attrs; rs->sr_flags = REP_ENTRY_MODIFIABLE; send_search_entry( op, rs ); + rs->sr_flags = 0; + rs->sr_attrs = NULL; } entry_clean( &e ); @@ -173,6 +175,8 @@ passwd_back_search( rs->sr_attrs = op->ors_attrs; rs->sr_flags = REP_ENTRY_MODIFIABLE; send_search_entry( op, rs ); + rs->sr_flags = 0; + rs->sr_entry = NULL; } entry_clean( &e ); @@ -238,6 +242,9 @@ passwd_back_search( rs->sr_attrs = op->ors_attrs; rs->sr_flags = REP_ENTRY_MODIFIABLE; send_search_entry( op, rs ); + rs->sr_flags = 0; + rs->sr_entry = NULL; + rs->sr_attrs = NULL; } entry_clean( &e ); @@ -324,10 +331,10 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) ber_str2bv( pw->pw_gecos, 0, 0, &val ); attr_merge_normalize_one( e, ad_desc, &val, NULL ); - s = strchr( val.bv_val, ',' ); + s = ber_bvchr( &val, ',' ); if ( s ) *s = '\0'; - s = strchr( val.bv_val, '&' ); + s = ber_bvchr( &val, '&' ); if ( s ) { char buf[1024];