vfs_rump: fix missing create arg in open

The plugin used to call open with the create flag set at rump without file
permissions for create leading to undefined behavior regarding the file
permissions.

Ref #5148
This commit is contained in:
Martin Stein 2024-03-27 16:57:54 +01:00 committed by Christian Helmuth
parent 65dfd2f9a8
commit 84285881f3

View File

@ -549,7 +549,8 @@ class Vfs::Rump_file_system : public File_system
if (create)
mode |= O_CREAT;
int fd = rump_sys_open(path, mode);
enum { DEFAULT_PERMISSIONS = 0777 };
int fd = create ? rump_sys_open(path, mode, DEFAULT_PERMISSIONS) : rump_sys_open(path, mode);
if (fd == -1) switch (errno) {
case ENAMETOOLONG: return OPEN_ERR_NAME_TOO_LONG;
case EACCES: return OPEN_ERR_NO_PERM;