matchpathcon

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

NAME

matchpathcon - get the default security context for the specified file from the policy.

 

SYNOPSIS

#include <selinux/selinux.h>

int matchpathcon(const char *path, mode_t mode, security_context_t *con);

 

DESCRIPTION


matchpathcon matches the specified pathname and mode against the file contexts configuration and sets the security context "con" to refer to the resulting context. "mode" can be 0 to disable mode matching, but should be provided whenever possible, as it may affect the matching.


Note:
   Caller must free returned security context "con" using freecon.  

RETURN VALUE

Returns 0 on success or -1 otherwise.

 

SEE ALSO

freecon(3), setfilecon(3), setfscreatecon(3)


 

Index

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