mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibWasm: Stop passing a nonzero 'mode' to open(..., O_DIRECTORY)
Bionic warns on this, but not passing the mode argument is technically undefined behaviour (depending on the libc implementation of open), as our LibC reads `mode` unconditionally (yolo!), just pass a zero to avoid the UB.
This commit is contained in:
parent
5f999097e5
commit
538c308357
Notes:
sideshowbarker
2024-07-17 20:58:35 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/538c308357 Pull-request: https://github.com/SerenityOS/serenity/pull/18650 Reviewed-by: https://github.com/gmta
|
@ -520,7 +520,7 @@ ErrorOr<Result<FileStat>> Implementation::impl$path_filestat_get(Configuration&
|
|||
auto& entry = preopened_directories()[descriptor.value()];
|
||||
dir_fd = entry.opened_fd.value_or_lazy_evaluated([&] {
|
||||
DeprecatedString path = entry.host_path.string();
|
||||
return open(path.characters(), O_DIRECTORY, 0755);
|
||||
return open(path.characters(), O_DIRECTORY, 0);
|
||||
});
|
||||
entry.opened_fd = dir_fd;
|
||||
},
|
||||
|
@ -583,7 +583,7 @@ ErrorOr<Result<void>> Implementation::impl$path_create_directory(Configuration&
|
|||
auto& entry = preopened_directories()[descriptor.value()];
|
||||
dir_fd = entry.opened_fd.value_or_lazy_evaluated([&] {
|
||||
DeprecatedString path = entry.host_path.string();
|
||||
return open(path.characters(), O_DIRECTORY, 0755);
|
||||
return open(path.characters(), O_DIRECTORY, 0);
|
||||
});
|
||||
entry.opened_fd = dir_fd;
|
||||
},
|
||||
|
@ -614,7 +614,7 @@ ErrorOr<Result<FD>> Implementation::impl$path_open(Configuration& configuration,
|
|||
auto& entry = preopened_directories()[descriptor.value()];
|
||||
dir_fd = entry.opened_fd.value_or_lazy_evaluated([&] {
|
||||
DeprecatedString path = entry.host_path.string();
|
||||
return open(path.characters(), O_DIRECTORY, 0755);
|
||||
return open(path.characters(), O_DIRECTORY, 0);
|
||||
});
|
||||
entry.opened_fd = dir_fd;
|
||||
},
|
||||
|
@ -706,7 +706,7 @@ ErrorOr<Result<FileStat>> Implementation::impl$fd_filestat_get(Configuration&, F
|
|||
auto& entry = preopened_directories()[descriptor.value()];
|
||||
resolved_fd = entry.opened_fd.value_or_lazy_evaluated([&] {
|
||||
DeprecatedString path = entry.host_path.string();
|
||||
return open(path.characters(), O_DIRECTORY, 0755);
|
||||
return open(path.characters(), O_DIRECTORY, 0);
|
||||
});
|
||||
entry.opened_fd = resolved_fd;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue