From 186630753f79536deeab32c88da106b4b0dd86f0 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Fri, 29 May 2026 22:22:10 +0200 Subject: [PATCH] nwserv: escape remaining protocol names in debug logs Use the bounded printable formatter for two remaining debug paths that can log protocol-derived byte fields directly. The SAP route suppression log can print SAP-derived server names, including non-printable bytes advertised by newer NetWare service types. The namespace search diagnostic can also contain DOS wildcard bytes such as 0xff padding. Format both fields through visable_data() so diagnostics stay readable and do not emit raw control or high-bit bytes. This is logging-only and does not change SAP, routing, or namespace behavior. --- src/namspace.c | 3 ++- src/nwroute.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/namspace.c b/src/namspace.c index 944ea42..8f5d559 100644 --- a/src/namspace.c +++ b/src/namspace.c @@ -1856,7 +1856,8 @@ int nw_search_file_dir(int namespace, int datastream, } XDPRINTF((5,0,"nw_s_f_d namsp=%d, sequence=%d, search='%s'", - namespace, sequence, entry )); + namespace, sequence, + visable_data(entry, sizeof(entry)) )); if ( (!sequence) || (sequence != dsh->lastsequence)) { XDPRINTF((5, 0, "dirpos set to 0 dsh->lastsequence = %d, dirpos=%d", diff --git a/src/nwroute.c b/src/nwroute.c index 30ec389..7b4cdb4 100644 --- a/src/nwroute.c +++ b/src/nwroute.c @@ -555,7 +555,8 @@ static void send_sip_to_net(uint32 nd_net, int nd_ticks, int mode) /* hops */ || ( mode == 2 && nw->hops) ) { /* no SAP to this NET */ XDPRINTF((3, 0, "No SAP mode=%d, to net=0x%x for server '%s'", - mode, nd_net, nw->name)); + mode, nd_net, + visable_data((uint8*)nw->name, MAX_SERVER_NAME))); continue; }