patches and low-level development discussion
 help / color / mirror / code / Atom feed
* Potential improvements to mount-flatpak
@ 2026-07-21 20:16 Demi Marie Obenour
  2026-07-22  8:17 ` Alyssa Ross
  0 siblings, 1 reply; 4+ messages in thread
From: Demi Marie Obenour @ 2026-07-21 20:16 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: Spectrum OS Development


[-- Attachment #1.1: Type: text/plain, Size: 1252 bytes --]

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.

- 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.

- Passing something that isn't a flatpak repository as a parameter
  will result in a confusing "no such file or directory" error.

- 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.

- The code that resolves the "active" symlink is duplicated.

- The target mount point is not made "noexec".

- 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.

Which, if any, of these ideas would make sense to include?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-27 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21 20:16 Potential improvements to mount-flatpak Demi Marie Obenour
2026-07-22  8:17 ` Alyssa Ross
2026-07-25  6:11   ` Demi Marie Obenour
2026-07-27 11:01     ` Alyssa Ross

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).