From: Alyssa Ross <hi@alyssa.is>
To: Demi Marie Obenour <demiobenour@gmail.com>
Cc: Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: Potential improvements to mount-flatpak
Date: Wed, 22 Jul 2026 10:17:29 +0200 [thread overview]
Message-ID: <87zezjtp46.fsf@alyssa.is> (raw)
In-Reply-To: <1bebc170-25cc-4c25-8b93-eef50e0e2685@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]
Demi Marie Obenour <demiobenour@gmail.com> writes:
> I looked at the mount-flatpak codebase and noticed some potential
> improvements for the future:
>
> - The code uses std::fs::write to write to files in the target
> directory. This is safe because the VM isn't running, but it might
> be better to use libpathrs.
I think it's fine.
> - The code doesn't validate the user-provided app ID, resulting in
> worse error messages than otherwise possible. App IDs are always
> D-Bus well-known names, so there is no risk of the rules changing
> in future versions of Flatpak.
Even though Flatpak 2 won't use D-Bus?
> - Passing something that isn't a flatpak repository as a parameter
> will result in a confusing "no such file or directory" error.
Could check that if it's cheap, since this is user-facing. I would not
spend much time on it though, since ultimately this should not be the
interface people use.
> - Various checks for corrupt repositories could be added, such as:
> - Wrong number of slashes in "current" symlink.
> - Wrong number of slashes in runtime path.
> - Bad "active" symlink.
I'm not sure I see the value? Does normal Flatpak do these checks?
I don't think we need to check everything that could possibly go wrong
if it wouldn't be a security concern.
> - The code that resolves the "active" symlink is duplicated.
I think there's already a patch sitting at the bottom of my inbox for
you from this.
> - The target mount point is not made "noexec".
Sounds like a good improvement.
> - mount_setattr() is called on a directory FD. I suspect this
> changes parameters of the source mount. It might be better to use
> open_tree_attr() with OPEN_TREE_CLONE instead.
Well, does it change the source mount or doesn't it? If there's a bug,
fix it; if there isn't, don't. (I do think you are probably right though.)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2026-07-22 8:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 20:16 Potential improvements to mount-flatpak Demi Marie Obenour
2026-07-22 8:17 ` Alyssa Ross [this message]
2026-07-25 6:11 ` Demi Marie Obenour
2026-07-27 11:01 ` Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zezjtp46.fsf@alyssa.is \
--to=hi@alyssa.is \
--cc=demiobenour@gmail.com \
--cc=devel@spectrum-os.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).