aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/fs.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-06 22:20:58 +0200
committerMarvin Borner2021-04-06 22:35:13 +0200
commit64ec8aa157e5d5d09372def37cbab00628e1e5f5 (patch)
tree13d0c864780a62506d40266fa6f2ab9571cbd216 /kernel/features/fs.c
parent9326d3970fe6eedbcb042ac68aca3074aacef32f (diff)
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
Diffstat (limited to 'kernel/features/fs.c')
-rw-r--r--kernel/features/fs.c4
1 files changed, 2 insertions, 2 deletions
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;
}