summaryrefslogtreecommitdiff
path: root/runtime/ops
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-10-29 17:05:55 -0400
committerGitHub <noreply@github.com>2021-10-29 17:05:55 -0400
commitd44011a69e0674acfa9c59bd7ad7f0523eb61d42 (patch)
tree405e9d56408b94977fe5ccd11db0941d3225b46f /runtime/ops
parentb7341438f29de88f3458b32a835bfad560bda52e (diff)
fix(runtime): require full read and write permissions to create symlinks (#12554)
Diffstat (limited to 'runtime/ops')
-rw-r--r--runtime/ops/fs.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs
index c3e9215a2..4c29898d7 100644
--- a/runtime/ops/fs.rs
+++ b/runtime/ops/fs.rs
@@ -1370,7 +1370,8 @@ fn op_symlink_sync(
let oldpath = PathBuf::from(&args.oldpath);
let newpath = PathBuf::from(&args.newpath);
- state.borrow_mut::<Permissions>().write.check(&newpath)?;
+ state.borrow_mut::<Permissions>().write.check_all()?;
+ state.borrow_mut::<Permissions>().read.check_all()?;
debug!(
"op_symlink_sync {} {}",
@@ -1432,7 +1433,8 @@ async fn op_symlink_async(
{
let mut state = state.borrow_mut();
- state.borrow_mut::<Permissions>().write.check(&newpath)?;
+ state.borrow_mut::<Permissions>().write.check_all()?;
+ state.borrow_mut::<Permissions>().read.check_all()?;
}
tokio::task::spawn_blocking(move || {