From 87aa3a46a3df36aeccdc5c93364fe1e71166c8fd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Aug 2024 08:25:16 +0200 Subject: [PATCH] lib/util: add a comment to struct server_id_buf BUG: https://bugzilla.samba.org/show_bug.cgi?id=15693 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- lib/util/server_id.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/util/server_id.h b/lib/util/server_id.h index 5b723d5cda4..988dd56de65 100644 --- a/lib/util/server_id.h +++ b/lib/util/server_id.h @@ -24,7 +24,23 @@ struct server_id; -struct server_id_buf { char buf[48]; }; /* probably a bit too large ... */ +struct server_id_buf { + /* + * 4294967295 uses 10 chars + * 18446744073709551615 uses 20 chars + * + * We have these combinations: + * - "disconnected" + * - PID64 + * - PID64.TASK32 + * - VNN32:PID64.TASK32 + * + * The largest has 10 + 1 + 20 + 1 + 10 + 1 = 43 chars + * + * Then we align it to a multiple of 8. + */ + char buf[48]; +}; bool server_id_same_process(const struct server_id *p1, const struct server_id *p2); -- 2.47.3