The getfilecon() API call is declared to return a security_context_t as follows:
int getfilecon(const char *path, security_context_t *con);
What is the formal definition of a security_context_t?
Anecdotally a security_context_t appears to be a char* containing four pieces of information separated by colons, is this always true?
If you were only interested in the file type (third field), would the correct way to parse this would be a regex like this?
^.*:.*:(.*):.*$
Is there an API I should be using to parse the context string?