]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/auditlog.c
More logging for ITS#4423
[openldap] / servers / slapd / overlays / auditlog.c
index c617bb02ba27763bc82dec6c0230ebbabc4e9dda..cc67c2b950b55dd2afedddc64cda5eaac52ec5ac 100644 (file)
@@ -52,13 +52,13 @@ static int auditlog_response(Operation *op, SlapReply *rs) {
        Attribute *a;
        Modifications *m;
        struct berval *b;
-       char *what, *subop, *suffix, *who = NULL;
+       char *what, *suffix, *who = NULL;
        long stamp = slap_get_time();
        int i;
 
        if ( rs->sr_err != LDAP_SUCCESS ) return SLAP_CB_CONTINUE;
 
-       if ( !op->o_bd || !ad->ad_logfile ) return SLAP_CB_CONTINUE;
+       if ( !ad->ad_logfile ) return SLAP_CB_CONTINUE;
 
 /*
 ** add or modify: use modifiersName if present
@@ -111,7 +111,7 @@ static int auditlog_response(Operation *op, SlapReply *rs) {
        switch(op->o_tag) {
          case LDAP_REQ_ADD:
                for(a = op->ora_e->e_attrs; a; a = a->a_next)
-                   if(b = a->a_vals)
+                 if((b = a->a_vals) != NULL)
                        for(i = 0; b[i].bv_val; i++)
                                fprint_ldif(f, a->a_desc->ad_cname.bv_val, b[i].bv_val, b[i].bv_len);
                break;
@@ -128,7 +128,8 @@ static int auditlog_response(Operation *op, SlapReply *rs) {
                                        continue;
                        }
                        fprintf(f, "%s: %s\n", what, m->sml_desc->ad_cname.bv_val);
-                       if(b = m->sml_values) for(i = 0; b[i].bv_val; i++)
+                       if((b = m->sml_values) != NULL)
+                         for(i = 0; b[i].bv_val; i++)
                                fprint_ldif(f, m->sml_desc->ad_cname.bv_val, b[i].bv_val, b[i].bv_len);
                        fprintf(f, "-\n");
                }
@@ -177,6 +178,7 @@ auditlog_db_close(
 
        free( ad->ad_logfile );
        ad->ad_logfile = NULL;
+       return 0;
 }
 
 static int
@@ -189,6 +191,7 @@ auditlog_db_destroy(
 
        ldap_pvt_thread_mutex_destroy( &ad->ad_mutex );
        free( ad );
+       return 0;
 }
 
 static int