【发布时间】:2020-04-02 13:24:52
【问题描述】:
我试图弄清楚 Selinux 是如何工作的,我在几个地方看到了一个名为 setcon 的函数,它在 selinux/selinux.h 中声明,并且有一个手册页条目。但是我在 libselinux 的源代码中找不到这个函数的实现(即源代码)。谁能告诉我 setcon 的源代码在哪里?非常感谢。
/* Set the current security context to con.
Note that use of this function requires that the entire application
be trusted to maintain any desired separation between the old and new
security contexts, unlike exec-based transitions performed via setexeccon.
When possible, decompose your application and use setexeccon()+execve()
instead. Note that the application may lose access to its open descriptors
as a result of a setcon() unless policy allows it to use descriptors opened
by the old context. */
extern int setcon(const char * con);
【问题讨论】:
标签: selinux