/* lastmod.c - returns last modification info */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2004-2005 The OpenLDAP Foundation.
+ * Copyright 2004-2006 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
char csnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE ];
struct berval entryCSN;
- slap_get_csn( NULL, csnbuf, sizeof(csnbuf), &entryCSN, 0 );
+ entryCSN.bv_val = csnbuf;
+ entryCSN.bv_len = sizeof( csnbuf );
+ slap_get_csn( NULL, &entryCSN, 0 );
ber_dupbv( bv_entryCSN, &entryCSN );
ber_dupbv( bv_nentryCSN, &entryCSN );
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
"null OID for attributeType '%s'\n",
mat[i].name, 0, 0 );
+ ldap_attributetype_free( at );
return -1;
}
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
"%s in attributeType '%s'\n",
scherr2str(code), mat[i].name, 0 );
+ ldap_attributetype_free( at );
return -1;
}
ldap_memfree(at);
Debug( LDAP_DEBUG_ANY,
"objectClass '%s' has no OID\n" ,
moc[i].name, 0, 0 );
+ ldap_objectclass_free( oc );
return -1;
}
Debug( LDAP_DEBUG_ANY,
"objectClass '%s': %s \"%s\"\n" ,
moc[i].name, scherr2str(code), err );
+ ldap_objectclass_free( oc );
return -1;
}
timestamp.bv_len = sizeof(tmbuf);
slap_timestamp( &starttime, ×tamp );
- slap_get_csn( NULL, csnbuf, sizeof(csnbuf), &entryCSN, 0 );
+ entryCSN.bv_val = csnbuf;
+ entryCSN.bv_len = sizeof( csnbuf );
+ slap_get_csn( NULL, &entryCSN, 0 );
if ( BER_BVISNULL( &lmi->lmi_rdnvalue ) ) {
ber_str2bv( "Lastmod", 0, 1, &lmi->lmi_rdnvalue );
static slap_overinst lastmod;
int
-lastmod_init()
+lastmod_initialize()
{
lastmod.on_bi.bi_type = "lastmod";
lastmod.on_bi.bi_db_init = lastmod_db_init;
int
init_module( int argc, char *argv[] )
{
- return lastmod_init();
+ return lastmod_initialize();
}
#endif /* SLAPD_OVER_LASTMOD == SLAPD_MOD_DYNAMIC */