version 1.7.2.6, 2008/02/11 23:26:48
|
version 1.7.2.7, 2008/04/14 21:18:48
|
Line 1
|
Line 1
|
/* auditlog.c - log modifications for audit/history purposes */ |
/* auditlog.c - log modifications for audit/history purposes */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/auditlog.c,v 1.7.2.5 2007/11/27 19:59:20 quanah Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/auditlog.c,v 1.7.2.6 2008/02/11 23:26:48 kurt Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
* Copyright 2005-2008 The OpenLDAP Foundation. |
* Copyright 2005-2008 The OpenLDAP Foundation. |
Line 74 static int auditlog_response(Operation *
|
Line 74 static int auditlog_response(Operation *
|
Modifications *m; |
Modifications *m; |
struct berval *b, *who = NULL; |
struct berval *b, *who = NULL; |
char *what, *suffix; |
char *what, *suffix; |
long stamp = slap_get_time(); |
time_t stamp; |
int i; |
int i; |
|
|
if ( rs->sr_err != LDAP_SUCCESS ) return SLAP_CB_CONTINUE; |
if ( rs->sr_err != LDAP_SUCCESS ) return SLAP_CB_CONTINUE; |
Line 125 static int auditlog_response(Operation *
|
Line 125 static int auditlog_response(Operation *
|
return SLAP_CB_CONTINUE; |
return SLAP_CB_CONTINUE; |
} |
} |
|
|
|
stamp = slap_get_time(); |
fprintf(f, "# %s %ld %s%s%s\n", |
fprintf(f, "# %s %ld %s%s%s\n", |
what, stamp, suffix, who ? " " : "", who ? who->bv_val : ""); |
what, (long)stamp, suffix, who ? " " : "", who ? who->bv_val : ""); |
|
|
if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) && |
if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) && |
(!who || !dn_match( who, &op->o_conn->c_dn ))) |
(!who || !dn_match( who, &op->o_conn->c_dn ))) |
Line 173 static int auditlog_response(Operation *
|
Line 174 static int auditlog_response(Operation *
|
break; |
break; |
} |
} |
|
|
fprintf(f, "# end %s %ld\n\n", what, stamp); |
fprintf(f, "# end %s %ld\n\n", what, (long)stamp); |
|
|
fclose(f); |
fclose(f); |
ldap_pvt_thread_mutex_unlock(&ad->ad_mutex); |
ldap_pvt_thread_mutex_unlock(&ad->ad_mutex); |