Where are ACL permissions checked when the file is opened in EXT2?

The EXT2 file.copen file operation is (.open)pointed to dquot_file_open, which points to generic_file_openwhich is present in fs/open.c.

generic_file_open looks like it has the code below

int generic_file_open(struct inode * inode, struct file * filp)
{
    if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
        return -EOVERFLOW;
    return 0;
}

Where are ACL permissions checked when opening a file?

When I googled and went through the code using LXR, I found the following path.

do_sys_open -> do_filp_open -> path_openat -> do_last -> may_open -> inode_permission -> do_inode_permission -> generic_permission -> acl_permission_check -> check_acl -> posix_acl_permission

but I could not understand how .open EXT2 is related to do_sys_open.

Any help is telling me that the path to checking acl permissions while the file is open will be appreciated.

+3
source share
2 answers

: do_sys_open VFS, ext2 open .

+2

, ACL; nameidata_to_filp __dentry_open:

__dentry_open():

    f->f_op = fops_get(inode->i_fop);
    /* ... */
    if (!open && f->f_op)
            open = f->f_op->open;
    if (open) {
            error = open(inode, f);
            if (error)
                    goto cleanup_all;
    }

inode->i_fop->open open, inode f.

+1

All Articles