mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-24 07:46:42 +00:00
vfs/rump: offer all files as read-writeable
The distinction between read-only and read-writeable is the responsibility of the front end, i.e., the vfs server.
This commit is contained in:
parent
25aa25c6a0
commit
cfba429c15
@ -194,7 +194,7 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
* We cannot use 'd_type' member of 'dirent' here since the EXT2
|
* We cannot use 'd_type' member of 'dirent' here since the EXT2
|
||||||
* implementation sets the type to unkown. Hence we use stat.
|
* implementation sets the type to unkown. Hence we use stat.
|
||||||
*/
|
*/
|
||||||
struct stat s;
|
struct stat s { };
|
||||||
rump_sys_lstat(path, &s);
|
rump_sys_lstat(path, &s);
|
||||||
|
|
||||||
auto dirent_type = [] (unsigned mode)
|
auto dirent_type = [] (unsigned mode)
|
||||||
@ -209,8 +209,8 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
return Dirent_type::END;
|
return Dirent_type::END;
|
||||||
};
|
};
|
||||||
|
|
||||||
Node_rwx const rwx { .readable = (s.st_mode & S_IRUSR),
|
Node_rwx const rwx { .readable = true,
|
||||||
.writeable = (s.st_mode & S_IWUSR),
|
.writeable = true,
|
||||||
.executable = (s.st_mode & S_IXUSR) };
|
.executable = (s.st_mode & S_IXUSR) };
|
||||||
|
|
||||||
vfs_dir = {
|
vfs_dir = {
|
||||||
@ -699,7 +699,7 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
|
|
||||||
Stat_result stat(char const *path, Stat &stat)
|
Stat_result stat(char const *path, Stat &stat)
|
||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb { };
|
||||||
if (rump_sys_lstat(path, &sb) != 0) return STAT_ERR_NO_ENTRY;
|
if (rump_sys_lstat(path, &sb) != 0) return STAT_ERR_NO_ENTRY;
|
||||||
|
|
||||||
auto type = [] (unsigned mode)
|
auto type = [] (unsigned mode)
|
||||||
@ -713,8 +713,8 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
stat = {
|
stat = {
|
||||||
.size = (file_size)sb.st_size,
|
.size = (file_size)sb.st_size,
|
||||||
.type = type(sb.st_mode),
|
.type = type(sb.st_mode),
|
||||||
.rwx = { .readable = (sb.st_mode & S_IRUSR),
|
.rwx = { .readable = true,
|
||||||
.writeable = (sb.st_mode & S_IWUSR),
|
.writeable = true,
|
||||||
.executable = (sb.st_mode & S_IXUSR) },
|
.executable = (sb.st_mode & S_IXUSR) },
|
||||||
.inode = sb.st_ino,
|
.inode = sb.st_ino,
|
||||||
.device = sb.st_dev,
|
.device = sb.st_dev,
|
||||||
|
Loading…
Reference in New Issue
Block a user