directory - 如何获取文件 inode 的指针

标签 directory inode

为了为 Linux 内核添加一些安全措施,我试图在 inode 结构中添加额外的标志。

如果为某个文件设置了这个标志,系统调用将检查它。

那么我如何才能访问知道其目录和/或其 inode 编号的文件的 inode 结构(可能通过指针)?

最佳答案

SELinux 提供 Hook 来添加基于 inode 访问的检查。查看标题为:Inode Hook Functions 的链接.

摘录

The SELinux inode hook function implementations manage the security fields of inode structures and perform access control for inode operations. Since inodes are used to represent pipes, files, and sockets, the hook functions must handle each of these abstractions. Furthermore, these hooks must handle multiple filesystem types, including both conventional disk-based filesystems like ext3 and pseudo filesystems like proc and tmpfs. This section begins by describing the inode hook functions for managing the security fields. It then discusses the inode hook functions for performing access control.

这是一个 good tutorial on getting started with SELinux .

引用资料

关于directory - 如何获取文件 inode 的指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16442265/

相关文章:

c - 是否可以通过修改 inode 数据结构和 super block 来连接同一 linux 文件系统上的两个文件?

php - INODES - 解决办法吗?

c - 有没有办法在 C 中为 i_block 创建迭代器风格的函数?

windows - 如何递归更改 WAMP 服务器上的文件夹权限

C++:我需要目录导航方面的帮助

linux - linux中如何判断一个文件的唯一性?

c - 为什么 inode 编号从 1 而不是 0 开始?

macos - 操作系统 X : Can I localize the name of a folder/directory?

ios - 你怎么称呼这个在 iOS 中查看的堆叠文件夹?

python - 如何根据每个项目设置PIPENV_VENV_IN_PROJECT