This currently causes binary data to be logged.
Instead, conditionally hex encode the key in a similar style to the
way it is done in dbwrap_ctdb.c:fetch_locked_internal(). In this
case, the key is truncated if the debug level is less than 10.`
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Feb 9 12:21:08 UTC 2026 on atb-devel-224
goto done;
}
- D_INFO("Vacuum Fetch record, key=%.*s\n",
- (int)fetch->key.dsize,
- fetch->key.dptr);
+ if (DEBUGLEVEL >= DBGLVL_INFO) {
+ char *keystr = hex_encode_talloc(
+ fetch,
+ (unsigned char *)fetch->key.dptr,
+ fetch->key.dsize);
+
+ D_INFO(DEBUGLEVEL >= DBGLVL_DEBUG ?
+ "Vacuum Fetch record, key=%s\n" :
+ "Vacuum Fetch record, key=%.20s\n",
+ keystr ? keystr : "<UNKNOWN>");
+ TALLOC_FREE(keystr);
+ }
(void) ctdb_local_schedule_for_deletion(fetch_queue->ctdb_db,
&hdr,