summaryrefslogtreecommitdiff
path: root/src/user/lib/fs
diff options
context:
space:
mode:
authordzwdz2022-08-12 00:30:14 +0200
committerdzwdz2022-08-12 00:30:14 +0200
commit215aa95c8d8c85985c1dcc5a994ad164823b39e6 (patch)
treea8346262dea6d5d32b552c8ccf407256d370e086 /src/user/lib/fs
parentd170ceb6c9f26f222558012ccbb75614ec2a6b8f (diff)
vfs: OPEN_RO flag, read-only whitelist entries
Diffstat (limited to 'src/user/lib/fs')
-rw-r--r--src/user/lib/fs/misc.c4
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;