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 AA9DC3D50; Sat, 15 Nov 2025 12:01:55 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 8FE943D3E; Sat, 15 Nov 2025 12:01:52 +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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) by atuin.qyliss.net (Postfix) with ESMTPS id EC71E3D3C for ; Sat, 15 Nov 2025 12:01:51 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id C57B9EC009B; Sat, 15 Nov 2025 07:01:50 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sat, 15 Nov 2025 07:01:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1763208110; x=1763294510; bh=/DdTpummKe JT3XyD1YIZkPJyh6uwilUeXV8w56LcflQ=; b=kEvjAyu0VzOM2UV0hCXDotrmYw tymJElbf9HlXO+Z3N4gtoGt1CKeWWDyIHndwOctYwsVKXflpV0qgqg6P5TUD8EaW huY6VOsCKigDirSYq7IpyyxWY6kQd/8RlcU8p1F3TxplNd1Z6Lr8g5pniS/F8RQX KD0TB+uCNGyKpZK6IIp1VVkQfRBofc+STOH72AOlpkImHJBBbE/r1GcXaibon4Jd rkJ07GCuhymJd3yIOFVigW+cqTvpMQ3tUO2t85hLZiFQLcNKweXPeCvs7DLRBbZX CxGK2Z0GPlR/bX7AQnUjIGnE5esb27E0EKHCQI5qkICL+rEOd78G7e895PyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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=fm3; t= 1763208110; x=1763294510; bh=/DdTpummKeJT3XyD1YIZkPJyh6uwilUeXV8 w56LcflQ=; b=VAe2EeMQl5XmW71xDEKJjVD72Hgr+S394nMLK1IBzVp/ikljgz8 Aui6+74PRfX+ylGnSVVmNhyfMPpp4D5U4iBg8Cc8ivfwJsGEnOSK8Uyx4xFSMp7b OowHIzlDczCD/sMeJaC/Ulaf96mnJlwN7xsuSbWWdwD/LE84/uVN/LX4nmgOBavM RuARZrZWksDmdgv0D/KAAjjrE/QRCoj4hMQ3c+pnBxMm0tFSx4NdArRnLBUgUPgj 8bnsX/OHqtf+9fiWqxNectJiGzkGYpQaTC02b4KAd4qbO9j6O1k2mEB4iEd4yRrk CoAFaYt8LAnQXRQDe2iEZDQgbsYMY/6TU+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvuddvieehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefujghffffkgggtsehgtderredttddtnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeeiudffue eilefgtefgtddttdekkeehkefgheekudefveetgeefiefftedvteeuveenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrd hishdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep uggvmhhiohgsvghnohhurhesghhmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlse hsphgvtghtrhhumhdqohhsrdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 15 Nov 2025 07:01:50 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id C026B226BBEE; Sat, 15 Nov 2025 13:01:48 +0100 (CET) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 1/3] tools/mount-flatpak: init In-Reply-To: <87ikfb4iat.fsf@alyssa.is> References: <20251113120452.65711-1-hi@alyssa.is> <87ldk8lvfi.fsf@alyssa.is> <87ikfb4iat.fsf@alyssa.is> Date: Sat, 15 Nov 2025 13:01:47 +0100 Message-ID: <87fraf4i8k.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: KE25AFS6ORHHSKFMS3FKAHTXYWRJPKBL X-Message-ID-Hash: KE25AFS6ORHHSKFMS3FKAHTXYWRJPKBL 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 CC: devel@spectrum-os.org 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: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Alyssa Ross writes: > Demi Marie Obenour writes: > >> On 11/14/25 06:12, Alyssa Ross wrote: >>> Demi Marie Obenour writes: >>>=20 >>>> On 11/13/25 07:04, Alyssa Ross wrote: >>>>> diff --git a/tools/mount-flatpak/mount-flatpak.c b/tools/mount-flatpa= k/mount-flatpak.c >>>>> new file mode 100644 >>>>> index 0000000..8e09d1d >>>>> --- /dev/null >>>>> +++ b/tools/mount-flatpak/mount-flatpak.c >>>>> @@ -0,0 +1,294 @@ >>>>> +// SPDX-License-Identifier: EUPL-1.2+ >>>>> +// SPDX-FileCopyrightText: 2025 Alyssa Ross >>>>> + >>>>> +#include "config.h" >>>>> +#include "metadata.h" >>>>> + >>>>> +#include >>>>> +#include >>>>> +#include >>>>> +#include >>>>> +#include >>>>> +#include >>>>> + >>>>> +#include >>>>> +#include >>>>> + >>>>> +#include >>>>> +#include >>>>> + >>>>> +static void bind_mount(int source_fd, const char *source, >>>>> + int target_fd, const char *target) >>>>> +{ >>>>> + int source_tree =3D syscall(SYS_open_tree, source_fd, source, >>>>> + AT_EMPTY_PATH | OPEN_TREE_CLOEXEC | >>>>> + OPEN_TREE_CLONE | AT_RECURSIVE); >>>>> + if (source_tree =3D=3D -1) >>>>> + err(EXIT_FAILURE, "open_tree %s", source); >>>>> + if (syscall(SYS_move_mount, source_tree, "", target_fd, target, >>>>> + MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH) =3D= =3D -1) >>>>> + err(EXIT_FAILURE, "move_mount"); >>>> >>>> Missing checks that target does not contain "/" and is not "." or "..". >>>=20 >>> Right, yes, move_mount doesn't have RESOLVE_BENEATH semantics. Ideally >>> I suppose we can leave target empty and only use an fd, but I don't >>> think that works in all circumstances. >> >> Which ones does it fail in? Also, should this set the mount read-only? > > I had it that way originally, but I decided to replace it with one > read-only self-bind-mount at the end because making just these read-only > and not the parent directories felt a bit ad-hoc. Oh and as for where it fails, I wasn't able to remount a directory over itself using empty paths for both. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQGoGac7QfI+H5ZtFCZddwkt31pFQUCaRhrqwAKCRCZddwkt31p FQdCAP9Rwnx7pkL+/K9j/AQGgqxtCjaaNOV5e22xTYx668qoQQEA/rXGXYR5M1F1 mbgYUn2vPKd9OkMuDqho4xj5qbXr0wQ= =qvvv -----END PGP SIGNATURE----- --=-=-=--