You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deno.getUid() and Deno.getGid() should just return null on Windows systems, but not require the --unstable keyword, so they can be used in deno_std for permission checks that are only necessary on POSIX systems.
Windows will raise a Deno.errors.PermissionDenied when calling Deno.stat on a directory/file that the user cannot read. However, on POSIX systems Deno.stat will success nonetheless. To avoid opening the file when trying to verify permissions, one could compare Deno.getUid() and Deno.getGid() to FileInfo.uid and FileInfo.gid to validate ownership of a given directory/file to further validate permissions by parsing FileInfo.mode accordantly.
FileInfo.mode returns null and Deno.chmod is not working on Windows, but those APIs requires no --unstable flag. So should Deno.getUid() and Deno.getGid() in my opinion.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Deno.getUid()
andDeno.getGid()
should just returnnull
on Windows systems, but not require the--unstable
keyword, so they can be used indeno_std
for permission checks that are only necessary on POSIX systems.This issue blocks #2785
Context:
Windows will raise a
Deno.errors.PermissionDenied
when callingDeno.stat
on a directory/file that the user cannot read. However, on POSIX systemsDeno.stat
will success nonetheless. To avoid opening the file when trying to verify permissions, one could compareDeno.getUid()
andDeno.getGid()
toFileInfo.uid
andFileInfo.gid
to validate ownership of a given directory/file to further validate permissions by parsingFileInfo.mode
accordantly.FileInfo.mode
returnsnull
andDeno.chmod
is not working on Windows, but those APIs requires no--unstable
flag. So shouldDeno.getUid()
andDeno.getGid()
in my opinion.The text was updated successfully, but these errors were encountered: