[PATCH] More robust MCOOKIE handling

B. Wilson xeohooleec at wilsonb.com
Sun Mar 9 04:55:16 UTC 2025


Hello,

When mcookie is not found at configure time, we were failing to correctly
set HAS_COOKIE_MAKER and MK_COOKIE, which ends up causing startx to think it
should run a command called MK_COOKIE. The attached patch fixes this case.

Additionally, when MCOOKIE is set to a valid path, we need to prevent further
preprocessor expansion on the result. In particular, the mcookie path for Nix
and Guix contain what looks like the token "linux", which is #defined by
default in gcc and clang. The attached patch fixes this by ensuring that the
MCOOKIE value is quoted inside the post-processed source.

However, as you can see, the current mechanism requires dancing around three
layers of quoting and is exremely fiddly. Perhaps we should add a
--with-mcookie configure option instead, which would be more robust and
rationalize mcookie configuration with all the other --with-* settings we have.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xinit-startx-mcookie-path.patch
Type: text/x-diff
Size: 900 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20250309/f8149818/attachment.patch>


More information about the xorg-devel mailing list