From 84285881f398bbc09b23b6851cd17471c7488dd8 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Wed, 27 Mar 2024 16:57:54 +0100 Subject: [PATCH] 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 --- repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc b/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc index c6ef6cb4a6..ed9151df46 100644 --- a/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc +++ b/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc @@ -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;