matchpathcon8
Get the default selinux security context for the specified path from the file contexts configuration
Usage
matchpathcon [-V]
[-N]
[-n]
[-m
type]
[-f
file_contexts_file]
[-p
prefix]
[-P
policy_root_path]
filepath ...
Overview
matchpathcon queries the system policy and outputs the default security context associated with the filepath.
Note: Identical paths can have different security contexts, depending on the file type (regular file, directory, link file, char file ...).
matchpathcon will also take the file type into consideration in determining the default security context if the file exists. If the file does not exist, no file type matching will occur.
Options
-mtype-
Force file type for the lookup. Valid types are
file,dir,pipe,chr_file,blk_file,lnk_file,sock_file
-
-n -
Do not display path
-
-N -
Do not use translations
|
Use alternate file_context file |
|---|---|
|
Use prefix to speed up translations |
|
Use alternate policy root path |
-
-V -
Verify file context on disk matches defaults
Examples
Show the default label of sock_file cups.sock # matchpathcon -m sock_file /var/run/cups/cups.sock Verify that /var/www/html directory is labeled correctly (the content of the folder is not checked) # matchpathcon -V /var/www/html
Releases
10 releases since Debian 4.0 (Etch); the text changed 4 times.
-N since Debian 8 (Jessie);
-V since Debian 8 (Jessie);
-n since Debian 8 (Jessie).