mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
Deno.makeTempDir() check permissions (#3810)
This commit is contained in:
parent
73a3cc21d0
commit
1c6c6c6d7f
1 changed files with 3 additions and 3 deletions
|
@ -539,13 +539,13 @@ fn op_make_temp_dir(
|
||||||
) -> Result<JsonOp, ErrBox> {
|
) -> Result<JsonOp, ErrBox> {
|
||||||
let args: MakeTempDirArgs = serde_json::from_value(args)?;
|
let args: MakeTempDirArgs = serde_json::from_value(args)?;
|
||||||
|
|
||||||
// FIXME
|
|
||||||
state.check_write(Path::new("make_temp"))?;
|
|
||||||
|
|
||||||
let dir = args.dir.map(PathBuf::from);
|
let dir = args.dir.map(PathBuf::from);
|
||||||
let prefix = args.prefix.map(String::from);
|
let prefix = args.prefix.map(String::from);
|
||||||
let suffix = args.suffix.map(String::from);
|
let suffix = args.suffix.map(String::from);
|
||||||
|
|
||||||
|
state
|
||||||
|
.check_write(dir.clone().unwrap_or_else(std::env::temp_dir).as_path())?;
|
||||||
|
|
||||||
let is_sync = args.promise_id.is_none();
|
let is_sync = args.promise_id.is_none();
|
||||||
blocking_json(is_sync, move || {
|
blocking_json(is_sync, move || {
|
||||||
// TODO(piscisaureus): use byte vector for paths, not a string.
|
// TODO(piscisaureus): use byte vector for paths, not a string.
|
||||||
|
|
Loading…
Reference in a new issue