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.
This commit is contained in:
lotherk committed 2026-11-18 06:18:50 +00:00
1 parent 9a950d0046
commit 24e1c5a51f
1 file changed
+9
+9
View File
@@ -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 {