mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 10:46:25 +00:00
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:
parent
65dfd2f9a8
commit
84285881f3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user