/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
SlapReply *rs )
{
struct passwd *pw;
- time_t stoptime;
+ time_t stoptime = (time_t)-1;
LDAPRDN rdn = NULL;
struct berval parent = BER_BVNULL;
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
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];
attr_merge_normalize_one( e, ad_sn, &val, NULL );
}
}
-#endif /* HAVE_PW_GECOS */
+#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */
return( 0 );
}