Compare commits

...

2 commits

Author SHA1 Message Date
copilot-swe-agent[bot]
7c77feedb9
Changes before error encountered
Agent-Logs-Url: https://github.com/vrc-get/vrc-get/sessions/82b59fb6-fb44-49c4-aec7-d2c3c15f6568

Co-authored-by: anatawa12 <22656849+anatawa12@users.noreply.github.com>
2026-04-21 15:14:07 +00:00
copilot-swe-agent[bot]
86ff13c3c8
Initial plan 2026-04-21 15:03:50 +00:00
4 changed files with 29 additions and 0 deletions

View file

@ -480,6 +480,20 @@ pub async fn project_open_unity(
return Ok(false);
}
#[cfg(unix)]
{
let project_path_ref = Path::new(project_path.as_str());
let check_dirs = ["Assets", "Packages", "Library"];
let is_noexec = check_dirs
.iter()
.map(|dir| project_path_ref.join(dir))
.filter(|p| p.exists())
.any(|p| crate::os::is_noexec(&p));
if is_noexec {
return Err(localizable_error!("projects:error:noexec mount point"));
}
}
let mut custom_args: Option<Vec<String>> = None;
{

View file

@ -88,6 +88,13 @@ pub fn initialize(app_handle: tauri::AppHandle) {
APPDIR.store(app_handle.env().appdir.clone().map(Arc::from));
}
pub(crate) fn is_noexec(path: &std::path::Path) -> bool {
match nix::sys::statvfs::statvfs(path) {
Ok(stat) => stat.flags().contains(nix::sys::statvfs::FsFlags::ST_NOEXEC),
Err(_) => false,
}
}
pub fn open_that(path: impl AsRef<OsStr>) -> io::Result<()> {
// We implement open_that here since we have to fix env variables for xdg-open.
// This implementation supports xdg-open only but it's general enough for most cases, I think

View file

@ -195,6 +195,13 @@ pub fn initialize(_: tauri::AppHandle) {
// nothing to initialize
}
pub(crate) fn is_noexec(path: &std::path::Path) -> bool {
match nix::sys::statfs::statfs(path) {
Ok(stat) => stat.flags().contains(nix::sys::statfs::MntFlags::MNT_NOEXEC),
Err(_) => false,
}
}
pub(crate) fn fix_env_variables(_: &mut Command) {
// nothing to do
}

View file

@ -52,3 +52,4 @@ pub fn os_info() -> &'static str {
pub use os_more::initialize;
pub use os_more::open_that;
pub use os_more::is_noexec;