Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

replcon(1) [centos man page]

replcon(1)                                                    General Commands Manual                                                   replcon(1)

NAME
replcon - SELinux file context replacement tool SYNOPSIS
replcon NEW_CONTEXT DIR [OPTIONS] [EXPRESSION] DESCRIPTION
replcon allows the user to find and replace file contexts. Replacements can be filtered by object class as described below. REQUIRED ARGUMENTS
NEW_CONTEXT The replacement context as expressed as a partial context, described below. DIR Initial directory to begin searching. The tool will recurse into any subdirectories, so be sure there are no circular mounts within it. EXPRESSION
The following options allow the user to specify which files to find. A file must meet all specified criteria for its context to be replaced. If no expression is provided, all files' contexts are replaced. -t TYPE, --type=TYPE Search for files with a context containing the type TYPE. -u USER, --user=USER Search for files with a context containing the user USER. -r ROLE, --role=ROLE Search for files with a context containing the role ROLE. -m RANGE, --mls-range=RANGE Search for files with a context with the MLS range of RANGE. Note that replcon ignores the SELinux translation library, if present. In addition, this flag is ignored if DIR has no MLS information. --context=CONTEXT Search for files matching this partial context. This flag overrides -t, -u, -r, and -m. -p PATH, --path=PATH Search for files which include PATH. -c CLASS, --class=CLASS Search only files of object class CLASS. OPTIONS
-v, --verbose Display context info during replacement. -h, --help Print help information and exit. -V, --version Print version information and exit. PARTIAL CONTEXT
The --context flag and NEW_CONTEXT argument specify a partial context, which is a a colon separated list of user, role, and type. If the system supports MLS, the context may have a fourth field that gives the range. With --context if a field is not specified or is the lit- eral asterisk, then the query will always match the field. With NEW_CONTEXT if a field is not specified or is the literal asterisk, then that portion of the context will not be modified. OBJECT CLASSES
Valid object class strings are block, char, dir, fifo, file, link, or sock. NOTE
The replcon utility always operates on "raw" SELinux file contexts. If the system has an installed translation library (i.e., libsetrans), those translations are ignored in favor of reading the original contexts from the filesystem. EXAMPLES
replcon ::type_t: . Replace every context's type in the current directory with type_t. The user and role portion remain unchanged. replcon -u user_u *:role_r:* . Replace every context's role with user user_u in the current directory with role_r. The user and type portion remain unchanged. replcon --context ::type_t:s0 :::s0:c0 /tmp Replace every context with type type_t and MLS range s0 in /tmp with MLS range s0:c0. AUTHOR
This manual page was written by Jeremy A. Mowery <jmowery@tresys.com>. COPYRIGHT
Copyright(C) 2003-2007 Tresys Technology, LLC BUGS
Please report bugs via an email to setools-bugs@tresys.com. SEE ALSO
findcon(1), indexcon(1) replcon(1)

Check Out this Related Man Page

RUNCON(1)							   User Commands							 RUNCON(1)

NAME
runcon - run command with specified security context SYNOPSIS
runcon CONTEXT COMMAND [args] runcon [ -c ] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args] DESCRIPTION
Run COMMAND with completely-specified CONTEXT, or with current or transitioned security context modified by one or more of LEVEL, ROLE, TYPE, and USER. If none of -c, -t, -u, -r, or -l, is specified, the first argument is used as the complete context. Any additional arguments after COMMAND are interpreted as arguments to the command. Note that only carefully-chosen contexts are likely to successfully run. Run a program in a different security context. With neither CONTEXT nor COMMAND, print the current security context. CONTEXT Complete security context -c, --compute compute process transition context before modifying -t, --type=TYPE type (for same role as parent) -u, --user=USER user identity -r, --role=ROLE role -l, --range=RANGE levelrange --help display this help and exit --version output version information and exit AUTHOR
Written by Russell Coker. REPORTING BUGS
Report runcon bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> COPYRIGHT
Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for runcon is maintained as a Texinfo manual. If the info and runcon programs are properly installed at your site, the command info coreutils 'runcon invocation' should give you access to the complete manual. GNU coreutils 7.1 July 2010 RUNCON(1)
Man Page