From 7a3c2a76f77ad754cb5cdd51093713c5282e598e Mon Sep 17 00:00:00 2001 From: Pedro Henrique Penna Date: Fri, 27 Nov 2026 19:09:32 -0800 Subject: [PATCH] nvx: limit platform-only checks to the platform module check_working_dir and check_owner_only_dir were crate-visible although only host::platform uses them, so make them private. Fixes #2304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nvx/src/host/platform/linux/private.rs | 2 +- nvx/src/host/platform/mod.rs | 2 +- nvx/src/host/platform/other.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nvx/src/host/platform/linux/private.rs b/nvx/src/host/platform/linux/private.rs index 213f3991d..b64e765d7 100644 --- a/nvx/src/host/platform/linux/private.rs +++ b/nvx/src/host/platform/linux/private.rs @@ -76,7 +76,7 @@ pub(crate) fn check_store_dir(path: &Path) -> io::Result> { /// Returns why the directory `path` is not private to the current user, if it is not: unless it /// is a directory, not a link to one, that belongs to the user and grants no one else any access. -pub(crate) fn check_owner_only_dir(path: &Path) -> io::Result> { +fn check_owner_only_dir(path: &Path) -> io::Result> { let Some(directory) = open_plain_dir(path)? else { return Ok(Some("is not a plain directory".to_owned())); }; diff --git a/nvx/src/host/platform/mod.rs b/nvx/src/host/platform/mod.rs index 86eb95c67..2c5b1cf40 100644 --- a/nvx/src/host/platform/mod.rs +++ b/nvx/src/host/platform/mod.rs @@ -307,7 +307,7 @@ pub(crate) fn sync_dir(dir: &Path) -> Result<()> { /// Refuses a VMM working directory that exceeds Windows' process-creation limit, without /// accessing the filesystem. #[cfg(windows)] -pub(crate) fn check_working_dir(path: &std::path::Path) -> Result<()> { +fn check_working_dir(path: &std::path::Path) -> Result<()> { use std::os::windows::ffi::OsStrExt; use windows_sys::Win32::Foundation::MAX_PATH; diff --git a/nvx/src/host/platform/other.rs b/nvx/src/host/platform/other.rs index 757b8c7ce..6cb8a2e7b 100644 --- a/nvx/src/host/platform/other.rs +++ b/nvx/src/host/platform/other.rs @@ -174,7 +174,7 @@ pub(crate) fn check_store_dir(_path: &Path) -> io::Result> { } /// Fails: this host cannot check who may access a directory. -pub(crate) fn check_owner_only_dir(_path: &Path) -> io::Result> { +fn check_owner_only_dir(_path: &Path) -> io::Result> { Err(unsupported()) }