From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id B64F118CCA; Tue, 09 Dec 2025 18:25:06 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 502D51893E; Tue, 09 Dec 2025 18:25:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) by atuin.qyliss.net (Postfix) with ESMTPS id 3234018924 for ; Tue, 09 Dec 2025 18:25:00 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 31B63EC050F for ; Tue, 9 Dec 2025 13:24:58 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Tue, 09 Dec 2025 13:24:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1765304698; x= 1765391098; bh=NHw9G4ZT/a7HEwu5V38V4wNwapD5q3cT4xyhrEQcwNA=; b=R tJuxfEaIvnAa2a1BmGR29SnBSNCS69rHjgbRlOiN2rJWb4n2gREZSngVIL78o/zT zo/Iwsvgtkk4TdViJr+jRG6pExUx8pzELn+3mvJ4/DGyKKT7OB7PKDHXEld/4w+C QjEZ1xKPuaK8cJxDog+vEvKvIwUso/SfkpHsxKDGOyeRUMPgbB3n/OCiTbjOt6UM SlT/5KNt6HHoyWumvmWxzRHf7I9FcRIC68sZXGEFx2XJMtjlEvo/BIHJT/AHEYt+ JvbkIBkEkS0W4gcKNvjYoG50unaQ8GpSJifZw9P2910dhVwhQg9dB4Me6AKsno1Y aqMz3y4967D9ecDsrTlVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1765304698; x=1765391098; bh=NHw9G4ZT/a7HEwu5V38V4wNwapD5 q3cT4xyhrEQcwNA=; b=aYsY1Wj8oIJ9mKk+YxgcZw552OsrtmQBun+e3huJXVTq PdFkDCO8YV8IZeB3Zf/U/FR7EuVUONjpZL4NJYiA23bCmlGJz6imMTS1Ewv1HMCV 7bFfAMSFQeP8cu8hsrp/BL8g718Vyk6QmadCH753FOQJKF40VpyuYZ+3APiCbSlA D593rUo194CBmbhAkPnBHgFWh+8yw1v6LZOjM1QrM3/rHabQQ8nsg0+tHvP5ms65 TgM0jLrHu/tbRMew0lrFoTpeyCu5tu+l0RbGZz8Y6rG7SGxq/FbdveeGYN4WZWIP vbgpxFNRR06vBZG4MbkX2D8DXg6OKxhO85zFms2A4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvtddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertd dtnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhsqeen ucggtffrrghtthgvrhhnpefgfedukedvleeileeludefveehgeelgfegvddujedvtdffue euveffheeljeekvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehhihesrghlhihsshgrrdhishdpnhgspghrtghpthhtohepuddpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepuggvvhgvlhesshhpvggtthhruhhmqdhoshdrohhr gh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 9 Dec 2025 13:24:57 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 1472A651B662; Tue, 09 Dec 2025 19:24:56 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH 2/2] host/rootfs: weston: run as non-root Date: Tue, 9 Dec 2025 19:24:02 +0100 Message-ID: <20251209182402.872822-2-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251209182402.872822-1-hi@alyssa.is> References: <20251209182402.872822-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: J4Q4K7WYAXS5IUXK6QWFOB2R45XWKY3S X-Message-ID-Hash: J4Q4K7WYAXS5IUXK6QWFOB2R45XWKY3S X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: WAYLAND_DISPLAY is moved from /run/wayland to /run/wayland/wayland because the wayland user doesn't have permission to create a file in /run. Signed-off-by: Alyssa Ross --- host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY | 2 +- host/rootfs/image/etc/s6-linux-init/run-image/etc/group | 6 +++--- host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd | 1 + .../etc/s6-linux-init/run-image/service/root-terminal/run | 2 ++ host/rootfs/image/etc/s6-rc/weston/run | 3 +++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY b/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY index bbd390c4..111060fc 100644 --- a/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY +++ b/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY @@ -1 +1 @@ -/run/wayland +/run/wayland/wayland diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/etc/group b/host/rootfs/image/etc/s6-linux-init/run-image/etc/group index fe72eb76..019f5525 100644 --- a/host/rootfs/image/etc/s6-linux-init/run-image/etc/group +++ b/host/rootfs/image/etc/s6-linux-init/run-image/etc/group @@ -2,9 +2,9 @@ root:x:0:root clock:x:1: dialout:x:2: kmem:x:3: -input:x:4: +input:x:4:wayland tty:x:5: -video:x:6: +video:x:6:wayland render:x:7: sgx:x:8: audio:x:9: @@ -13,4 +13,4 @@ disk:x:11: cdrom:x:12: tape:x:13: kvm:x:14: -wayland:x:15: +wayland:x:15:wayland diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd b/host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd index 29f3b252..50def56d 100644 --- a/host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd +++ b/host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd @@ -1 +1,2 @@ root:x:0:0:System administrator:/:/bin/sh +wayland:x:15:15:Wayland compositor:/:/bin/nologin diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/service/root-terminal/run b/host/rootfs/image/etc/s6-linux-init/run-image/service/root-terminal/run index 67ccfb45..86b9a1ef 100755 --- a/host/rootfs/image/etc/s6-linux-init/run-image/service/root-terminal/run +++ b/host/rootfs/image/etc/s6-linux-init/run-image/service/root-terminal/run @@ -4,6 +4,8 @@ s6-ipcserver-socketbinder -a 0700 /run/root-terminal +if { chown wayland /run/root-terminal } + fdmove 1 3 s6-ipcserverd -1P diff --git a/host/rootfs/image/etc/s6-rc/weston/run b/host/rootfs/image/etc/s6-rc/weston/run index 2674ec0b..7d10b5b4 100644 --- a/host/rootfs/image/etc/s6-rc/weston/run +++ b/host/rootfs/image/etc/s6-rc/weston/run @@ -34,10 +34,13 @@ backtick HOME { homeof $user } +if { install -do wayland -g wayland -m 0770 /run/wayland } +if { chown wayland /dev/tty0 /dev/tty1 } redirfd -r 0 /dev/tty1 importas -i home HOME cd $home if { udevadm wait /dev/dri/card0 } unshare --cgroup --ipc --net --uts +s6-setuidgid wayland weston -S $WAYLAND_DISPLAY -- 2.51.0