Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid fd_advise on directories #240

Merged
merged 4 commits into from
Dec 11, 2023
Merged

Conversation

yagehu
Copy link
Contributor

@yagehu yagehu commented Dec 5, 2023

This commit adds a check to fd_advise. If the fd is a directory, return ebadf. This brings uvwasi in line with Wasmtime's behavior. WASI folks have stated that fd_advise should not work on directories as this is a Linux-specific behavior.

This commit adds a check to `fd_advise`.  If the fd is a directory,
return `ebadf`.  This brings uvwasi in line with Wasmtime's behavior.
WASI folks have stated that fd_advise should not work on directories
as this is a Linux-specific behavior.
@yagehu yagehu force-pushed the yagehu/fd_advise_dir branch from abce2dd to d5af30f Compare December 5, 2023 22:33
Copy link
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems correct to me.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson
Copy link
Member

mhdawson commented Dec 7, 2023

@yagehu can you take a look at the failure on Windows?

@yagehu
Copy link
Contributor Author

yagehu commented Dec 7, 2023

@yagehu can you take a look at the failure on Windows?

I pushed a fix. Thanks!

@yagehu
Copy link
Contributor Author

yagehu commented Dec 7, 2023

Sorry for the noise. I'll test on a Windows machine today and try again.

@yagehu
Copy link
Contributor Author

yagehu commented Dec 8, 2023

I tested the commit on Win 11. It compiles and passes the fd_advise test.

@mhdawson mhdawson merged commit dc2cbab into nodejs:main Dec 11, 2023
7 checks passed
@yagehu yagehu deleted the yagehu/fd_advise_dir branch April 10, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants