From 215aa95c8d8c85985c1dcc5a994ad164823b39e6 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 12 Aug 2022 00:30:14 +0200 Subject: vfs: OPEN_RO flag, read-only whitelist entries --- src/user/lib/fs/misc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/user/lib/fs') 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; -- cgit v1.2.3