Add support for group-based permission checking in ext2

This commit is contained in:
anbo225
2024-12-12 16:59:16 +08:00
committed by Tate, Hongliang Tian
parent 6cea8d2a8c
commit e75b6320ad
16 changed files with 153 additions and 42 deletions

View File

@ -18,7 +18,7 @@ use super::{
};
use crate::{
fs::utils::{Extension, FallocMode, InodeMode, Metadata},
process::{Gid, Uid},
process::{posix_thread::AsPosixThread, Gid, Uid},
};
/// Max length of file name.
@ -2075,11 +2075,12 @@ impl TryFrom<RawInode> for InodeDesc {
impl InodeDesc {
pub fn new(type_: InodeType, perm: FilePerm) -> Dirty<Self> {
let now = now();
let credentials = current_thread!().as_posix_thread().unwrap().credentials();
Dirty::new_dirty(Self {
type_,
perm,
uid: 0,
gid: 0,
uid: credentials.fsuid().into(),
gid: credentials.fsgid().into(),
size: 0,
atime: now,
ctime: now,