From 015bbc298ff2eecebba09968b7c3ff41a65b6d12 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 29 Sep 2022 11:53:07 +0200 Subject: [PATCH] MINOR: tools: Impprove hash_ipanon to not hash FD-based addresses "stdout" and "stderr" are not hashed. In the same spirit, "fd@" and "sockpair@" prefixes are not hashed too. There is no reason to hash such address and it may be useful to diagnose bugs. No backport needed, except if anonymization mechanism is backported. --- src/tools.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools.c b/src/tools.c index 5185204b1..33bc88e6d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -5895,7 +5895,11 @@ const char *hash_ipanon(uint32_t scramble, char *ipstring, int hasport) if (scramble == 0) { return ipstring; } - if (strcmp(ipstring, "localhost") == 0) { + if (strcmp(ipstring, "localhost") == 0 || + strcmp(ipstring, "stdout") == 0 || + strcmp(ipstring, "stderr") == 0 || + strncmp(ipstring, "fd@", 3) == 0 || + strncmp(ipstring, "sockpair@", 9) == 0) { return ipstring; } else {