getcon

Section: SE Linux API documentation (3)
Updated: 1 January 2004
 

NAME

getcon, getprevcon, getpidcon - get SE Linux security context of a process.  

SYNOPSIS

#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);

 

DESCRIPTION

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.

 

RETURN VALUE

On error -1 is returned. On success 0 is returned.

 

SEE ALSO

freecon(3), setexeccon(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO
blog comments powered by Disqus