From 64ec8aa157e5d5d09372def37cbab00628e1e5f5 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 6 Apr 2021 22:20:58 +0200 Subject: Made exec syscall relative using app name My plan is to implement a mobile-OS-like sandboxing using manifests and permission middlewares. Let's see if I can manage to do this without sacrificing too much performance. I'm also wondering whether I should implement open/close syscalls which would result in a cleaner block/unblock mechanism. I need to think. Hmmm.. Naa --- kernel/features/fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel/features/fs.c') diff --git a/kernel/features/fs.c b/kernel/features/fs.c index 47e7891..b5bb2a4 100644 --- a/kernel/features/fs.c +++ b/kernel/features/fs.c @@ -565,7 +565,7 @@ static res read_inode(struct ext2_inode *in, void *buf, u32 offset, u32 count, s static u32 find_inode(const char *name, u32 dir_inode, struct device *dev) { - if (!dir_inode) + if ((signed)dir_inode <= 0) return (unsigned)-1; struct ext2_inode i = { 0 }; @@ -624,7 +624,7 @@ static struct ext2_inode *find_inode_by_path(const char *path, struct ext2_inode current_inode = find_inode(path_cp, current_inode, dev); path_cp[i] = '/'; - if (current_inode == 0) { + if ((signed)current_inode <= 0) { free(init); return NULL; } -- cgit v1.2.3