From 24e1c5a51fa507032fbb0cb8b95653033d52789b Mon Sep 17 00:00:00 2001 From: lotherk Date: Wed, 18 Nov 2026 06:18:50 +0000 Subject: [PATCH] libSM: client IDs from uuid_create(3); dtsession refuses a NULL ID The login went back to the greeter: dtsession dumped core (~/dtsession.core, SIGSEGV in strlen <- strdup <- SmsRegisterClientReply <- SmXSMP.c:562, return address 0x1fb5c in the PIE). NetBSD builds libSM without UUID support, so SmsGenerateClientID derives the ID from the host name's address and returns NULL when the name does not resolve (sm_genid.c, getaddrinfo) -- an offline machine whose name is not in /etc/hosts, the installed test VM, the workstation without network. - src/external/mit/xorg/lib/libSM/Makefile: -DHAVE_UUID_CREATE, libc's DCE uuid_create/uuid_to_string (the branch sm_genid.c has for FreeBSD). - dtsession SmXSMP.c: a NULL ID refuses that client instead of killing the session manager. --- programs/dtsession/SmXSMP.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/programs/dtsession/SmXSMP.c b/programs/dtsession/SmXSMP.c index a1624855..6204a72a 100644 --- a/programs/dtsession/SmXSMP.c +++ b/programs/dtsession/SmXSMP.c @@ -503,6 +503,15 @@ RegisterClientProc ( if (!previousId) { id = SmsGenerateClientID (smsConn); + /* + * MCDE: libSM returns NULL when it cannot make an ID (a libSM + * without UUID support on a host whose name does not resolve). + * SmsRegisterClientReply would strdup(NULL) and the session + * manager -- the whole session -- would die (2026-11-18). + * Refuse this one client instead. + */ + if (id == NULL) + return (0); sendSave = True; } else {