--- libselinux-1.17.2/man/man3/matchpathcon.3.rhat 2004-08-26 08:37:17.533537517 -0400 +++ libselinux-1.17.2/man/man3/matchpathcon.3 2004-08-26 08:36:21.061471154 -0400 @@ -0,0 +1,26 @@ +.TH "matchpathcon" "3" "1 August 2004" "dwalsh@redhat.com" "SE Linux API documentation" +.SH "NAME" +matchpathcon \- get the default security context for the specified file from the policy. + +.SH "SYNOPSIS" +.B #include +.sp +.BI "int matchpathcon(const char *" path ", mode_t " mode ", security_context_t *" con);" +.br + +.SH "DESCRIPTION" +.br +.B matchpathcon +matches the specified pathname and mode against the file contexts configuration and set the security context "con" to refer to the resulting context. "mode" can be 0 to disable mode matching. +.sp +.br +.B Note: + Caller must free returned security context "con" using freecon. +.SH "RETURN VALUE" +On error -1 is returned. + +On success matchpathcon returns the length of the context (not including +the trailing zero byte). + +.SH "SEE ALSO" +.BR freecon "(3), " setfilecon "(3), " setfscreatecon "(3)"