]> git.sur5r.net Git - openldap/commitdiff
ITS#4394 fix segfault
authorHoward Chu <hyc@openldap.org>
Fri, 10 Feb 2006 00:31:17 +0000 (00:31 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 10 Feb 2006 00:31:17 +0000 (00:31 +0000)
servers/slapd/overlays/auditlog.c

index 441df6c68fd062f69fd30e1324523b4d50aa6878..c617bb02ba27763bc82dec6c0230ebbabc4e9dda 100644 (file)
@@ -36,7 +36,7 @@ typedef struct auditlog_data {
        char *ad_logfile;
 } auditlog_data;
 
-int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) {
+static int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) {
        char *s;
        if((s = ldif_put(LDIF_PUT_VALUE, name, val, len)) == NULL)
                return(-1);
@@ -45,7 +45,7 @@ int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) {
        return(0);
 }
 
-int auditlog_response(Operation *op, SlapReply *rs) {
+static int auditlog_response(Operation *op, SlapReply *rs) {
        slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
        auditlog_data *ad = on->on_bi.bi_private;
        FILE *f;
@@ -78,7 +78,9 @@ int auditlog_response(Operation *op, SlapReply *rs) {
                case LDAP_REQ_MODIFY:
                        what = "modify";
                        for(m = op->orm_modlist; m; m = m->sml_next)
-                               if( m->sml_desc == slap_schema.si_ad_modifiersName ) {
+                               if( m->sml_desc == slap_schema.si_ad_modifiersName &&
+                                       ( m->sml_op == LDAP_MOD_ADD ||
+                                       m->sml_op == LDAP_MOD_REPLACE )) {
                                        who = m->sml_values[0].bv_val;
                                        break;
                                }