X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-passwd%2Fsearch.c;h=23a74ab53aedaa0ec8e49534cfd3b034654a97e8;hb=f96e6378d6cd06c744a47af5e5e551cbb494826a;hp=e32e8b9b6dbb65f7f6d4dfeb80085a0f6e5d1892;hpb=18d18d25dc3b9487d80f8400b44f7eb59e20fcd1;p=openldap diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index e32e8b9b6d..23a74ab53a 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-2006 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; @@ -312,7 +312,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) attr_merge_normalize_one( e, slap_schema.si_ad_cn, &val, NULL ); /* required by person */ attr_merge_normalize_one( e, ad_sn, &val, NULL ); /* required by person */ -#ifdef HAVE_PW_GECOS +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS /* * if gecos is present, add it as a cn. first process it * according to standard BSD usage. If the processed cn has @@ -324,10 +324,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]; @@ -352,7 +352,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) attr_merge_normalize_one( e, ad_sn, &val, NULL ); } } -#endif /* HAVE_PW_GECOS */ +#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */ return( 0 ); }