[PATCH] More robust MCOOKIE handling

Alan Coopersmith alan.coopersmith at oracle.com
Mon Mar 10 21:24:22 UTC 2025


On 3/8/25 20:55, B. Wilson wrote:
> 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.

Patches submitted via merge request at
https://gitlab.freedesktop.org/xorg/app/xinit/
are far less likely to be lost/forgotten than those submitted via email,
which X.Org doesn't really use for patch submission these days.

This patch conflicts with the changes already merged from
https://gitlab.freedesktop.org/xorg/app/xinit/-/merge_requests/22
and which were just shipped yesterday in xinit 1.4.4, also to deal
with systems in which mcookie was not found and to reduce the layers
of quote processing involved by no longer using cpp to pre-preprocess
the scripts.

-- 
         -Alan Coopersmith-                 alan.coopersmith at oracle.com
          Oracle Solaris Engineering - https://blogs.oracle.com/solaris


More information about the xorg-devel mailing list