From 1ff5352d2ae9b24638aa9567f1d1f39e654132c1 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Thu, 11 Nov 2021 09:18:49 +0900 Subject: [PATCH] ext2: Assign correct ownership of new files --- modules/ext2.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/ext2.c b/modules/ext2.c index 727e9cb7..1bbd9274 100644 --- a/modules/ext2.c +++ b/modules/ext2.c @@ -965,8 +965,8 @@ static int mkdir_ext2(fs_node_t * parent, char * name, mode_t permission) { inode->size = 0; /* empty */ /* Assign it to root */ - inode->uid = 0; /* FIXME */; - inode->gid = 0; /* FIXME */; + inode->uid = this_core->current_process->user; + inode->gid = this_core->current_process->user_group; /* misc */ inode->faddr = 0; @@ -1060,9 +1060,8 @@ static int create_ext2(fs_node_t * parent, char * name, mode_t permission) { inode->blocks = 0; inode->size = 0; /* empty */ - /* Assign it to root */ - inode->uid = 0; /* FIXME */; - inode->gid = 0; /* FIXME */; + inode->uid = this_core->current_process->user; + inode->gid = this_core->current_process->user_group; /* misc */ inode->faddr = 0; @@ -1472,8 +1471,8 @@ static int symlink_ext2(fs_node_t * parent, char * target, char * name) { inode->size = 0; /* empty */ /* Assign it to current user */ - inode->uid = 0; /* FIXME */; - inode->gid = 0; /* FIXME */; + inode->uid = this_core->current_process->user; + inode->gid = this_core->current_process->user_group; /* misc */ inode->faddr = 0;