GNU/Linux |
CentOS 4.8 |
i386 |
getcon(3) |
getcon, getprevcon, getpidcon − get SE Linux security context of a process.
#include <selinux/selinux.h>
int
getcon(security_context_t *context);
int getprevcon(security_context_t *context);
int getpidcon(pid_t pid, security_context_t
*context);
int getpeercon(int fd, security_context_t
*context);
getcon retrieves the context of the current process, which must be free’d with freecon.
getprevcon same as getcon but gets the context before the last exec.
getpidcon returns the process context for the specified PID.
getpeercon retrieves context of peer socket, and set *context to refer to it, which must be free’d with freecon.
On error -1 is returned. On success 0 is returned.
freecon(3), setexeccon(3)
getcon(3) |