From patchwork Sun Mar 9 04:23:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "B. Wilson" X-Patchwork-Id: 39958 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 777ED27BBEA; Sun, 9 Mar 2025 04:25:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7C5CB27BBE2 for ; Sun, 9 Mar 2025 04:25:36 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tr8Ds-0002W3-Tg; Sat, 08 Mar 2025 23:25:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tr8Dp-0002SX-Kp for guix-patches@gnu.org; Sat, 08 Mar 2025 23:25:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tr8Dn-0006VM-TD for guix-patches@gnu.org; Sat, 08 Mar 2025 23:25:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:Subject; bh=MwOxyZM9VpezENA2FR3cWRIoZDgUc5oVJeCVwCIVIBs=; b=OqZEuCdgOkQDWrMIa7rWiOVep09mOGfpjlomtU8h9GI0ItEKA8tBwgYFqFm+2/RsZ7W/kcZNbvDN8+mvTtruB3HZ1XWn4prw8qTMOHEV9HH5JkNB55Mees5wXtUIkY9s6dphx06Y/Xy2nxWOmm5PHJm/0kSZqbU6qWKV9BR8zBShGj32TMD+TK93ydrUS0eNc062XiWLh3E6pHIJj+UyTQhz9aQtJb81grGE3li4l3Bu1sBcUFUN9Q7qXxmcjUkFvlYe2I77tpESUH2EYqwIM1kg4ymg6+JhcFr7qGFelQuG5kQFUVXUyj+p+wsrpk38vi+kiRTORzPx2rFvlGTpdQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tr8Dm-0000jh-P4 for guix-patches@gnu.org; Sat, 08 Mar 2025 23:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76878] gnu: xinit: Fix broken mcookie path in startx. Resent-From: B. Wilson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 09 Mar 2025 04:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 76878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 76878@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17414942472732 (code B ref -1); Sun, 09 Mar 2025 04:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Mar 2025 04:24:07 +0000 Received: from localhost ([127.0.0.1]:57588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tr8Cs-0000hz-KD for submit@debbugs.gnu.org; Sat, 08 Mar 2025 23:24:07 -0500 Received: from lists.gnu.org ([2001:470:142::17]:38036) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tr8Cp-0000hN-6J for submit@debbugs.gnu.org; Sat, 08 Mar 2025 23:24:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tr8Ci-0002L8-8P for guix-patches@gnu.org; Sat, 08 Mar 2025 23:23:56 -0500 Received: from m42-5.mailgun.net ([69.72.42.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tr8Cf-0006DD-Oz for guix-patches@gnu.org; Sat, 08 Mar 2025 23:23:55 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1741494231; x=1741501431; h=Content-Type: MIME-Version: Message-Id: Subject: Subject: From: From: To: To: Date: Sender: Sender; bh=MwOxyZM9VpezENA2FR3cWRIoZDgUc5oVJeCVwCIVIBs=; b=jyDogejqprTTy4TX8vgdR0GzSRamxU2Va5ReunY+K4xCuXdnTRlJkUOR+I14mNUFzqvXh+9g71AwzQ3EWG/WHC/uEkdavcDoM730Ltp16zxGlZ0MyiLUOy3DsixcHSl73Z6oLuU4gcW+Ypd1f7fI9dIP7cHOaszPqkY2GujpeZ4DSvABezRzh1L/h1A5p7RCbOYYU9DwrTBH0M3drJrCWry9/Vu4ko88kKIwog35RPb6V4lkw4Ac9BmWh1f4UXCYmvhPSk3HeMOMgFDVGR1H+tcnUcE5mbHV5CxFvQXP00l6x7feMm7f4SitLMwHSuZfAah2RH0cBsZm4RKTlUeF6w== X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sending-Ip-Pool-Name: X-Mailgun-Sending-Ip-Pool: X-Mailgun-Sid: WyI5MmEzMyIsImd1aXgtcGF0Y2hlc0BnbnUub3JnIiwiMDg1NDdhIl0= Received: from wilsonb.com (wilsonb.com [104.199.203.42]) by 1f86744badb7 with SMTP id 67cd17d76c41ba7804b515ab (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Sun, 09 Mar 2025 04:23:51 GMT Received: from localhost (softbank126227227137.bbtec.net [126.227.227.137]) by wilsonb.com (Postfix) with ESMTPSA id 82876A190C for ; Sun, 9 Mar 2025 04:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1741494228; bh=MwOxyZM9VpezENA2FR3cWRIoZDgUc5oVJeCVwCIVIBs=; h=Date:To:From:Subject:From; b=gmYdeEcoi7MFFGZAlT+xiRrGScSjNuvms5T2teLNoXB0jhX8ux8Kwg5tTLYv3dN3M sbVSkHRuAO/ujj3T89HvG8K8vvrEcSO9MummwTS5c3mpeoVcUjNF1LCJJ5wFx2jGwk qagkmfaPZIonga+IZoMf4wmHctUJPnxIMIsikVola0BsiUip1uLw8AbBc6mPzecBVb noDoFITnDjYD5GqZaC32zshCns+AFjA4IHXc45onDj68eHKrA6maps8USRjjdd2Dho lcJuIpFoF1VQ3CLq1UKx8sOeq9vREuaTAtO4eAMzfXPCbJtONkg3zLp5P09QGBLkSr lvWTe4l3LM+GAehWCHN4+UBUIO3ZgmiXIkNQbOEeAdBaS1U3lDABaPPJmp7MkEqjtC L+69ZKca8u48MhAE7juAeTsHvWo18yEob4npPPAg3lptdDki4SbBKBK4WFVd8qoAXb I4tiwzbNYpGi77XzIVYkAa/aER40Lhvxenzk7veX4TE6MDZzMB07IHmR9msvYPWO5w wX2lKdG05EYvD5LECtIuSqM8tTOXD+WeYAmvjMMjyQC7Bmv4wrwmJTgViaL9EAEc0/ Js3dfkat21rz07NZlYnclhLEog9HhL4StHFZkS+2CpbCKHv6xi9Ju9nK6F7xGl80ef CqWHMFqcw9Px94WrDh9pveNY= Date: Sun, 09 Mar 2025 13:23:41 +0900 Message-Id: <3TFGIH7KFRA8E.2O2IVAVY05SK6@example.com> User-Agent: mblaze/1.2 MIME-Version: 1.0 Received-SPF: pass client-ip=69.72.42.5; envelope-from=bounce+686de0.08547a-guix-patches=gnu.org@mg.wilsonb.com; helo=m42-5.mailgun.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: "B. Wilson" X-ACL-Warn: , "B. Wilson via Guix-patches" X-Patchwork-Original-From: "B. Wilson via Guix-patches" via From: "B. Wilson" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches The xinit upgrade to 1.4.3 introduced a large upstream changeset that ends up breaking startx in a couple cases. This commit patches the upstream build to 1) let startx use mcookie, and 2) protect the injected mcookie path. From daef339310d7fe902623187ea5df19fc797d00d4 Mon Sep 17 00:00:00 2001 From: "B. Wilson" Date: Sun, 9 Mar 2025 13:12:55 +0900 Subject: [PATCH] gnu: xinit: Fix broken mcookie path in startx. * gnu/packages/patches/xinit-startx-mcookie-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patch. * gnu/packages/xorg.scm (xinit)[source]: Add patch. --- gnu/local.mk | 3 ++- .../patches/xinit-startx-mcookie-path.patch | 23 +++++++++++++++++++ gnu/packages/xorg.scm | 14 +++++------ 3 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 gnu/packages/patches/xinit-startx-mcookie-path.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9082ed04bf..5f5e219e85 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2422,7 +2422,8 @@ dist_patch_DATA = \ %D%/packages/patches/xfig-Fix-double-free-when-requesting-MediaBox.patch \ %D%/packages/patches/xfig-Use-pkg-config-to-set-fontconfig-CFLAGS-and-LIBS.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ - %D%/packages/patches/xgboost-use-system-dmlc-core.patch \ + %D%/packages/patches/xgboost-use-system-dmlc-core.patch \ + %D%/packages/patches/xinit-startx-mcookie-path.patch \ %D%/packages/patches/xmonad-dynamic-linking.patch \ %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \ %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ diff --git a/gnu/packages/patches/xinit-startx-mcookie-path.patch b/gnu/packages/patches/xinit-startx-mcookie-path.patch new file mode 100644 index 0000000000..050603433b --- /dev/null +++ b/gnu/packages/patches/xinit-startx-mcookie-path.patch @@ -0,0 +1,23 @@ +This patch fixes two bugs in upstream mcookie detection: 1) If mcookie is not +detected, we still need to set HAS_COOKIE_HANDLER and MK_COOKIE, and 2) the +value for MK_COOKIE must be a string in order to disallow further preprocessor +expansions. + +In particular for 2, if we fail to surround the path in quotes, our path +contains the token "linux", which gcc further expands, creating an invalid +path. + +--- a/configure.ac 2025-03-08 16:48:34.476791744 +0900 ++++ b/configure.ac 2025-03-08 16:48:30.208791623 +0900 +@@ -157,8 +157,10 @@ + fi + fi + if test "x$MCOOKIE" != x ; then +- STARTX_COOKIE_FLAGS='-DHAS_COOKIE_MAKER -DMK_COOKIE="$(MCOOKIE)"' ++ STARTX_COOKIE_FLAGS='-DHAS_COOKIE_MAKER -DMK_COOKIE="'"'"'$(MCOOKIE)'"'"'"' + AC_MSG_NOTICE([startx will depend on "$MCOOKIE" to generate xauth cookies]) ++else ++ STARTX_COOKIE_FLAGS='-DHAS_COOKIE_MAKER -DMK_COOKIE=' + fi + AC_SUBST(STARTX_COOKIE_FLAGS) + diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 15ee9edc79..db34a58f6e 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -42,6 +42,7 @@ ;;; Copyright © 2024 Nicolas Graves ;;; Copyright © 2025 Artyom V. Poptsov ;;; Copyright © 2025 宋文武 +;;; Copyright © 2025 B. Wilson ;;; ;;; This file is part of GNU Guix. ;;; @@ -5898,14 +5899,13 @@ (define-public xinit version ".tar.xz")) (sha256 (base32 - "0npx32mi035xkz26gp7raps5xsq4v7rgayy1q794h4d3lqhryh46")))) + "0npx32mi035xkz26gp7raps5xsq4v7rgayy1q794h4d3lqhryh46")) + (patches + (search-patches "xinit-startx-mcookie-path.patch")))) (build-system gnu-build-system) - (inputs - (list xorgproto libx11)) - (native-inputs - (list pkg-config)) - (propagated-inputs - (list xauth)) + (inputs (list libx11 util-linux xorgproto)) + (native-inputs (list pkg-config)) + (propagated-inputs (list xauth)) (home-page "https://www.x.org/") (synopsis "Commands to start the X Window server") (description -- 2.48.1