]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-passwd/search.c
Merge remote branch 'origin/mdb.master'
[openldap] / servers / slapd / back-passwd / search.c
index f34f80d52370234d414176ccc8eb0b481cd0be13..6a4258ab2c1e8eaabd4d50a110e53e06393e5a02 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * 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
@@ -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];