linked_attributes: Use ldb_ldif_message_redacted_string() for consistency
authorAndrew Bartlett <abartlet@samba.org>
Wed, 6 Sep 2017 03:56:59 +0000 (15:56 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 7 Sep 2017 04:56:27 +0000 (06:56 +0200)
This avoids printing un-encrypted secret values in logs, and while links are not likely
secret, this avoids a future copy and paste using ldb_ldif_message_string() again.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/linked_attributes.c

index 2016524a2d4138bce1285c2b3e7cad9793944c24..c6beb25e58b48e81e2aacc964be981dea30ffad0 100644 (file)
@@ -1136,14 +1136,18 @@ static int la_do_op_request(struct ldb_module *module, struct la_context *ac, st
 
        if (DEBUGLVL(4)) {
                DEBUG(4,("Applying linked attribute change:\n%s\n",
-                        ldb_ldif_message_string(ldb, op, LDB_CHANGETYPE_MODIFY, new_msg)));
+                        ldb_ldif_message_redacted_string(ldb, op,
+                                                         LDB_CHANGETYPE_MODIFY,
+                                                         new_msg)));
        }
 
        ret = dsdb_module_modify(module, new_msg, DSDB_FLAG_NEXT_MODULE, ac->req);
        if (ret != LDB_SUCCESS) {
                ldb_debug(ldb, LDB_DEBUG_WARNING, __location__ ": failed to apply linked attribute change '%s'\n%s\n",
                          ldb_errstring(ldb),
-                         ldb_ldif_message_string(ldb, op, LDB_CHANGETYPE_MODIFY, new_msg));
+                         ldb_ldif_message_redacted_string(ldb, op,
+                                                          LDB_CHANGETYPE_MODIFY,
+                                                          new_msg));
        }
 
        return ret;