+/* $OpenLDAP$ */
/*
* Copyright 1998-1999 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>
#include <sys/file.h>
#endif
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
+#include <disptmpl.h>
#include "ldap_log.h"
-#include "disptmpl.h"
#include "ldap-int.h"
#include "ldap_defaults.h"
struct ldap_disptmpl *tmpl;
struct timeval timeout;
- if ( dn == NULL && entry == NULLMSG ) {
+ if ( dn == NULL && entry == NULL ) {
ld->ld_errno = LDAP_PARAM_ERROR;
return( ld->ld_errno );
}
if ( tmpllist != NULL ) {
- ldmp = NULLMSG;
+ ldmp = NULL;
if ( entry == NULL ) {
char *ocattrs[2];
/* POSIX says tm_year should be year - 1900 */
t.tm_year = 100 * GET2BYTENUM( p ) - 1900;
p += 2;
+ t.tm_year += GET2BYTENUM( p ); p += 2;
+
+ } else {
+ /* came without a century */
+ t.tm_year = GET2BYTENUM( p ); p += 2;
+
+ /* Y2K hack - 2 digit years < 70 are 21st century */
+ if( t.tm_year < 70 ) {
+ t.tm_year += 100;
+ }
}
- t.tm_year = GET2BYTENUM( p ); p += 2;
t.tm_mon = GET2BYTENUM( p ) - 1; p += 2;
t.tm_mday = GET2BYTENUM( p ); p += 2;
/*
* Y2K YEAR
*/
- /* per POSIX tm_year should be offset by 1900 */
+ /* per STDC & POSIX tm_year should be offset by 1900 */
#define YEAR_POSIX(y) ((y) + 1900)
/*
*/
#define YEAR_CAREFUL(y) ((y) < 1900 ? (y) + 1900 : (y))
- /*
- ** if year is < 1990 and < 70 must be offset by 2000 as Unix epoch
- ** started in 1970. if year is < 1990 but >= 70, offset by 1900.
- ** if year is >= 1900, it must be the real year.
- */
-#define YEAR_PEDANTIC(y) ((y) < 1900 \
- ? ((y) < 70 ? (y) + 2000 ? (y) + 1900) \
- : (y))
-
#define YEAR(y) YEAR_CAREFUL(y)
/* \f */
return( LDAP_PARAM_ERROR );
} else if ( strcasecmp( attr, "-dnt" ) == 0 ) {
value = dn;
+ } else if ( strcasecmp( attr, "-dn" ) == 0 ) {
+ value = dn;
} else if (( vals = ldap_get_values( ld, entry, attr )) != NULL ) {
value = vals[ 0 ];
} else {