diff options
author | dzwdz | 2022-08-12 00:30:14 +0200 |
---|---|---|
committer | dzwdz | 2022-08-12 00:30:14 +0200 |
commit | 215aa95c8d8c85985c1dcc5a994ad164823b39e6 (patch) | |
tree | a8346262dea6d5d32b552c8ccf407256d370e086 /src/user | |
parent | d170ceb6c9f26f222558012ccbb75614ec2a6b8f (diff) |
vfs: OPEN_RO flag, read-only whitelist entries
Diffstat (limited to 'src/user')
-rw-r--r-- | src/user/lib/fs/misc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/user/lib/fs/misc.c b/src/user/lib/fs/misc.c index 16e95e7..038cd3b 100644 --- a/src/user/lib/fs/misc.c +++ b/src/user/lib/fs/misc.c @@ -87,6 +87,10 @@ void fs_whitelist(const char **list) { for (const char **iter = list; *iter; iter++) { size_t len = strlen(*iter); + if (len >= 3 && !memcmp(*iter + len - 3, ":ro", 3)) { + res.flags = res.flags | OPEN_RO; + len -= 3; + } if (len <= res.len && !memcmp(buf, *iter, len)) { passthru = true; break; |