/* $OpenLDAP$ */
/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/*
#include <stdio.h>
+#include <ac/socket.h>
#include <ac/stdlib.h>
#include <ac/ctype.h>
ocattrs[0] = OCATTRNAME;
ocattrs[1] = NULL;
-#ifdef LDAP_CONNECTIONLESS
- if ( LDAP_IS_CLDAP( ld ))
- err = cldap_search_s( ld, dn, LDAP_SCOPE_BASE,
- "objectClass=*", ocattrs, 0, &ldmp, NULL );
- else
-#endif /* LDAP_CONNECTIONLESS */
- err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE,
- "objectClass=*", ocattrs, 0, &timeout, &ldmp );
+ err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE,
+ NULL, ocattrs, 0, &timeout, &ldmp );
if ( err == LDAP_SUCCESS ) {
entry = ldap_first_entry( ld, ldmp );
}
fetchattrs = ldap_tmplattrs( tmpl, NULL, 1, LDAP_SYN_OPT_DEFER );
}
-#ifdef LDAP_CONNECTIONLESS
- if ( LDAP_IS_CLDAP( ld ))
- err = cldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*",
- fetchattrs, 0, &ldmp, NULL );
- else
-#endif /* LDAP_CONNECTIONLESS */
- err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "objectClass=*",
+ err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, NULL,
fetchattrs, 0, &timeout, &ldmp );
if ( freedn ) {
return( fmterr );
}
- memset( (char *)&t, 0, sizeof( struct tm ));
+ memset( (char *)&t, '\0', sizeof( struct tm ));
p = ldtimestr;
/* POSIX says tm_year should be year - 1900 */
t.tm_year = 100 * GET2BYTENUM( p ) - 1900;
p += 2;
- t.tm_year = GET2BYTENUM( p ); p += 2;
+ t.tm_year += GET2BYTENUM( p ); p += 2;
} else {
/* came without a century */
- t.tm_year = GET2BYTENUM( p ); p += 2;
+ t.tm_year = GET2BYTENUM( p ); p += 2;
/* Y2K hack - 2 digit years < 70 are 21st century */
if( t.tm_year < 70 ) {
timestr[ strlen( timestr ) - 1 ] = zone; /* replace trailing newline */
if ( dateonly ) {
- SAFEMEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 );
+ AC_MEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 );
}
return( timestr );
timeout.tv_sec = SEARCH_TIMEOUT_SECS;
timeout.tv_usec = 0;
-#ifdef LDAP_CONNECTIONLESS
- if ( LDAP_IS_CLDAP( ld ))
- lderr = cldap_search_s( ld, base, LDAP_SCOPE_SUBTREE, filter, retattrs,
- 0, &ldmp, NULL );
- else
-#endif /* LDAP_CONNECTIONLESS */
lderr = ldap_search_st( ld, base, LDAP_SCOPE_SUBTREE, filter, retattrs,
0, &timeout, &ldmp );