mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +00:00
Kernel: Start adding various file system permission checks.
Fail with EACCES in various situations. Fix userland bugs that were exposed.
This commit is contained in:
parent
43075e5878
commit
f5f136931a
Notes:
sideshowbarker
2024-07-19 15:39:09 +09:00
Author: https://github.com/awesomekling
Commit: f5f136931a
7 changed files with 96 additions and 8 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <AK/kstdio.h>
|
||||
#include <AK/BufferStream.h>
|
||||
#include <LibC/errno_numbers.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
//#define EXT2_DEBUG
|
||||
|
||||
|
@ -1183,13 +1184,13 @@ RetainPtr<Inode> Ext2FS::create_inode(InodeIdentifier parent_id, const String& n
|
|||
ext2_inode e2inode;
|
||||
memset(&e2inode, 0, sizeof(ext2_inode));
|
||||
e2inode.i_mode = mode;
|
||||
e2inode.i_uid = 0;
|
||||
e2inode.i_uid = current->euid();
|
||||
e2inode.i_gid = current->egid();
|
||||
e2inode.i_size = size;
|
||||
e2inode.i_atime = timestamp;
|
||||
e2inode.i_ctime = timestamp;
|
||||
e2inode.i_mtime = timestamp;
|
||||
e2inode.i_dtime = 0;
|
||||
e2inode.i_gid = 0;
|
||||
e2inode.i_links_count = initial_links_count;
|
||||
|
||||
success = write_block_list_for_inode(inode_id, e2inode, blocks);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue