2008-08-19 19:30:36 +00:00
.TH "fixfiles" "8" "2002031409" "" ""
.SH "NAME"
fixfiles \- fix file SELinux security contexts.
.SH "SYNOPSIS"
2017-05-07 11:05:47 +00:00
.na
2008-08-19 19:30:36 +00:00
2017-05-07 11:05:52 +00:00
.B fixfiles
policycoreutils: fixfiles: remove bad modes of "relabel" command
* `fixfiles -B relabel` or `fixfiles -C previouscontext relabel` would
skip the code that handles e.g. `/var/tmp`, which would be run by
`fixfiles relabel`. It would still remove all files in /tmp (subject to
user confirmation). This is confusing, undocumented, and unlikely to
be intentional.
* `fixfiles relabel path1 path2` is the same, except it would only relabel
the first path.
* `fixfiles -R ... relabel` was equivalent to `fixfiles -R ... restore`,
again contradicting the man page.
Also `fixfiles onboot` would ignore paths, -C, or -R.
fixfiles is mostly for users, where it should be acceptable to remove these
non-sensical combinations.
`fixfiles -C` is used in selinux-policy rpm install scripts. However I
believe the rpms used `fixfiles -C previouscontext restore`, and did not
either require user interaction or blow away /tmp without prompting. So
they should still work fine.
With these combinations removed, we can remove the `exit` calls which were
seen in some of the (non-error) code paths in `restore()`.
Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
2017-05-07 11:05:54 +00:00
.I [\-v] [\-F] [\-f] relabel
2017-05-07 11:05:52 +00:00
.B fixfiles
policycoreutils: fixfiles: remove bad modes of "relabel" command
* `fixfiles -B relabel` or `fixfiles -C previouscontext relabel` would
skip the code that handles e.g. `/var/tmp`, which would be run by
`fixfiles relabel`. It would still remove all files in /tmp (subject to
user confirmation). This is confusing, undocumented, and unlikely to
be intentional.
* `fixfiles relabel path1 path2` is the same, except it would only relabel
the first path.
* `fixfiles -R ... relabel` was equivalent to `fixfiles -R ... restore`,
again contradicting the man page.
Also `fixfiles onboot` would ignore paths, -C, or -R.
fixfiles is mostly for users, where it should be acceptable to remove these
non-sensical combinations.
`fixfiles -C` is used in selinux-policy rpm install scripts. However I
believe the rpms used `fixfiles -C previouscontext restore`, and did not
either require user interaction or blow away /tmp without prompting. So
they should still work fine.
With these combinations removed, we can remove the `exit` calls which were
seen in some of the (non-error) code paths in `restore()`.
Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
2017-05-07 11:05:54 +00:00
.I [\-v] [\-F] { check | restore | verify } dir/file ...
.B fixfiles
.I [\-v] [\-F] [\-B | \- N time ] { check | restore | verify }
2008-08-19 19:30:36 +00:00
2009-11-03 15:37:13 +00:00
.B fixfiles
2017-05-07 11:05:47 +00:00
.I [\-v] [\-F] \- R rpmpackagename[,rpmpackagename...] { check | restore | verify }
2009-11-03 15:37:13 +00:00
2017-05-07 11:05:47 +00:00
.B fixfiles
.I [\-v] [\-F] \- C PREVIOUS_FILECONTEXT { check | restore | verify }
.B fixfiles
.I [-F] [-B] onboot
2009-11-03 15:37:13 +00:00
2017-05-07 11:05:47 +00:00
.ad
2008-08-19 19:30:36 +00:00
.SH "DESCRIPTION"
This manual page describes the
.BR fixfiles
script.
.P
This script is primarily used to correct the security context
database (extended attributes) on filesystems.
.P
It can also be run at any time to relabel when adding support for
new policy, or just check whether the file contexts are all
as you expect. By default it will relabel all mounted ext2, ext3, xfs and
jfs file systems as long as they do not have a security context mount
2013-10-09 18:37:31 +00:00
option. You can use the \- R flag to use rpmpackages as an alternative.
2011-07-10 12:14:14 +00:00
The file /etc/selinux/fixfiles_exclude_dirs can contain a list of directories
2013-10-09 18:37:31 +00:00
excluded from relabeling.
2008-08-19 19:30:36 +00:00
.P
.B fixfiles onboot
will setup the machine to relabel on the next reboot.
.SH "OPTIONS"
.TP
2013-10-09 18:37:31 +00:00
.B \- B
If specified with onboot, this fixfiles will record the current date in the /.autorelabel file, so that it can be used later to speed up labeling. If used with restore, the restore will only affect files that were modified today.
.TP
.B \- F
Force reset of context to match file_context for customizable files
2008-08-19 19:30:36 +00:00
.TP
2013-10-09 18:37:31 +00:00
.B \- f
2008-08-19 19:30:36 +00:00
Clear /tmp directory with out prompt for removal.
.TP
2013-10-09 18:37:31 +00:00
.B \- R rpmpackagename[,rpmpackagename...]
2017-05-07 11:05:53 +00:00
Use the rpm database to discover all files within the specified packages and restore the file contexts.
2008-08-19 19:30:36 +00:00
.TP
2013-10-09 18:37:31 +00:00
.B \- C PREVIOUS_FILECONTEXT
2008-08-19 19:30:36 +00:00
Run a diff on the PREVIOUS_FILECONTEXT file to the currently installed one, and restore the context of all affected files.
2012-02-03 16:56:39 +00:00
.TP
2013-10-09 18:37:31 +00:00
.B \- N time
Only act on files created after the specified date. Date must be specified in
2013-11-06 12:24:01 +00:00
"YYYY\- MM\- DD HH:MM" format. Date field will be passed to find \- \- newermt command.
2013-10-09 18:37:31 +00:00
.TP
2012-02-03 16:56:39 +00:00
.B -v
2013-11-06 12:24:01 +00:00
Modify verbosity from progress to verbose. (Run restorecon with \- v instead of \- p)
2012-02-03 16:56:39 +00:00
2008-08-19 19:30:36 +00:00
.SH "ARGUMENTS"
One of:
.TP
.B check
print any incorrect file context labels, showing old and new context, but do not change them.
.TP
.B restore
change any incorrect file context labels.
.TP
.B relabel
Prompt for removal of contents of /tmp directory and then change any incorrect file context labels to match the install file_contexts file.
.TP
.B verify
List out files with incorrect file context labels, but do not change them.
.TP
.B [[dir/file] ... ]
List of files or directories trees that you wish to check file context on.
.SH "AUTHOR"
This man page was written by Richard Hally <rhally@mindspring.com>.
The script was written by Dan Walsh <dwalsh@redhat.com>
.SH "SEE ALSO"
2017-01-11 12:41:09 +00:00
.BR setfiles (8),
.BR restorecon (8)
2008-08-19 19:30:36 +00:00