Skip to content

Commit

Permalink
Always set restrict flag on file open
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfouilleul committed Jun 5, 2024
1 parent 8596cc0 commit 3a1fda0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/runtime_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ oc_io_cmp oc_bridge_io_wait_single_req(oc_io_req* wasmReq)
req.buffer = buffer;

//TODO: lookup in a compile-time table which operations use a 'at' handle that must be replaced by root handle if 0.
if(req.op == OC_IO_OPEN_AT && req.handle.h == 0)
if(req.op == OC_IO_OPEN_AT)
{
//NOTE: change root to app local folder
req.handle = orca->rootDir;
if(req.handle.h == 0)
{
//NOTE: change root to app local folder
req.handle = orca->rootDir;
}
req.open.flags |= OC_FILE_OPEN_RESTRICT;
}
}
Expand Down

0 comments on commit 3a1fda0

Please sign in to comment.