diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-11-04 20:16:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-05 04:16:53 +0000 |
commit | f9a05068d6de247574fb764044a446d1d7ed2e9b (patch) | |
tree | f11a18b1d373b102184f6bf44a100e637544aa90 /cli/util | |
parent | 383cb85a730e42a2951ead84233ccef0ed3a23e8 (diff) |
fix(install): handle invalid function error, and fallback to junctions regardless of the error (#26730)
Fixes #26116.
Handle the new error and treat is as lacking permission to make
symlinks, but also to make this more robust, just always fall back to
junctions no matter what the actual error is. Instead, warn if the error
isn't one we've handled, but go on to attempt creating the junction
Diffstat (limited to 'cli/util')
-rw-r--r-- | cli/util/fs.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/util/fs.rs b/cli/util/fs.rs index 2c34f486a..d36c02242 100644 --- a/cli/util/fs.rs +++ b/cli/util/fs.rs @@ -565,7 +565,9 @@ pub fn symlink_dir(oldpath: &Path, newpath: &Path) -> Result<(), Error> { use std::os::windows::fs::symlink_dir; symlink_dir(oldpath, newpath).map_err(|err| { if let Some(code) = err.raw_os_error() { - if code as u32 == winapi::shared::winerror::ERROR_PRIVILEGE_NOT_HELD { + if code as u32 == winapi::shared::winerror::ERROR_PRIVILEGE_NOT_HELD + || code as u32 == winapi::shared::winerror::ERROR_INVALID_FUNCTION + { return err_mapper(err, Some(ErrorKind::PermissionDenied)); } } |