mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 03:13:23 +00:00
Add support for group-based permission checking in ext2
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
6cea8d2a8c
commit
e75b6320ad
@ -12,6 +12,7 @@ use crate::{
|
||||
fs::{
|
||||
fs_resolver::{FsPath, FsResolver, AT_FDCWD},
|
||||
path::Dentry,
|
||||
utils::Permission,
|
||||
},
|
||||
prelude::*,
|
||||
};
|
||||
@ -77,7 +78,11 @@ pub fn check_executable_file(dentry: &Dentry) -> Result<()> {
|
||||
return_errno_with_message!(Errno::EACCES, "the dentry is not a regular file");
|
||||
}
|
||||
|
||||
if !dentry.mode()?.is_executable() {
|
||||
if dentry
|
||||
.inode()
|
||||
.check_permission(Permission::MAY_EXEC)
|
||||
.is_err()
|
||||
{
|
||||
return_errno_with_message!(Errno::EACCES, "the dentry is not executable");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user