fixfiles(8)
π fixfiles(8) β like, the SELinux context glow-up manual π
okay bestie, sit down, hydrate, and let me tell you about fixfiles β it's a fixfiles(8) manual page and it is literally the script that fixes file SELinux security contexts. no cap. π¦
β¨ NAME β¨
fixfiles β fix file SELinux security contexts. that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
okay so there are like, six whole ways to run this thing and you gotta pick the one that matches your situation. here they all are, exactly as written, no edits:
fixfiles [-v] [-F] [-M] [-f] [-T nthreads] relabel
fixfiles [-v] [-F] [-T nthreads] { check | restore | verify } dir/file
...
fixfiles [-v] [-F] [-B | -N time ] [-T nthreads] { check | restore |
verify }
fixfiles [-v] [-F] [-T nthreads] -R rpmpackagename[,rpmpackagename...] {
check | restore | verify }
fixfiles [-v] [-F] [-T nthreads] -C PREVIOUS_FILECONTEXT { check |
restore | verify }
fixfiles [-F] [-M] [-B] [-T nthreads] onboot
β¨ DESCRIPTION β¨
so this manual page is describing the fixfiles script, periodt. β¨
its whole main character job? correcting the security context database (that's the extended attributes, iykyk) on your filesystems. π
you can also run it any time to relabel when you're adding support for a new policy, or just to check whether the file contexts are all behaving the way you expect. by default it will relabel all mounted ext2, ext3, ext4, gfs2, xfs, jfs and btrfs file systems β as long as they do not have a security context mount option. π«Ά
want a different approach? you can use the -R flag to use rpmpackages as an alternative. and heads up: the file /etc/selinux/fixfiles_exclude_dirs can contain a list of directories that get excluded from relabeling. π
and fixfiles onboot will set up the machine to relabel on the next reboot. iconic behaviour honestly. π₯
β¨ OPTIONS β¨
every single one, bestie, no skipping. π
-Bβ if you specify this withonboot, this fixfiles will record the current date in the/.autorelabelfile, so it can be used later to speed up labeling. and if you use it withrestore, the restore will only affect files that were modified today. β-Fβ force reset of context to matchfile_contextfor customizable files. π-fβ clear the/tmpdirectory with out prompt for removal. π-R rpmpackagename[,rpmpackagename...]β use the rpm database to discover all files within the specified packages and restore the file contexts. π-C PREVIOUS_FILECONTEXTβ run a diff on thePREVIOUS_FILECONTEXTfile against the currently installed one, and restore the context of all affected files. π¦-N timeβ only act on files created after the specified date. the date must be specified in"YYYY-MM-DD HH:MM"format. the date field will be passed to thefind --newermtcommand. β°-Mβ bind mount filesystems before relabeling them; this allows fixing the context of files or directories that have been mounted over. π-vβ modify verbosity from progress to verbose. (it runsrestoreconwith-vinstead of-p.) π¬-T nthreadsβ use parallel relabeling, seesetfiles(8). π₯
β¨ ARGUMENTS β¨
you pick one of these, bestie:
check | verifyβ print any incorrect file context labels, showing old and new context, but do not change them. just a lil look, no touching. πrestoreβ change any incorrect file context labels. πrelabelβ prompt for removal of contents of the/tmpdirectory and then change any incorrect file context labels to match the installfile_contextsfile. π[[dir/file] ... ]β list of files or directories trees that you wish to check file context on. πΈ
β¨ EXAMPLE β¨
here are the lil glow-up recipes, copy them exactly bestie:
relabel the whole filesystem, except paths listed in /etc/selinux/fixfiles_exclude_dirs
# fixfiles relabel
schedule the machine to relabel on the next boot and force relabeling of customizable types
# fixfiles -F onboot
check labeling of all files from the samba package (while not changing any labels)
# fixfiles -R samba check
β¨ AUTHOR β¨
this man page was written by Richard Hally <rhally@mindspring.com>. the script was written by Dan Walsh <dwalsh@redhat.com>. legends, honestly. π«Ά
β¨ SEE ALSO β¨
setfiles(8), restorecon(8) β go read those too, they're giving supporting cast. π
and that's the whole page, bestie!! π this was the fixfiles(8) page, dated 2002031409, and you absolutely ate that read. go forth and relabel responsibly. mwah. πβ¨π
π¦ where this page comes from
- centos-stream 10: policycoreutils 3.11-1.el10 Β· GPL-2.0-or-later
- centos-stream 9: policycoreutils 3.6-9.el9 Β· GPL-2.0-or-later
- debian trixie: policycoreutils 3.8.1-2
- fedora 43: policycoreutils 3.9-5.fc43 Β· GPL-2.0-or-later
- fedora 43: policycoreutils 3.9-7.fc43 Β· GPL-2.0-or-later
- fedora 44: policycoreutils 3.10-1.fc44 Β· GPL-2.0-or-later
- fedora 44: policycoreutils 3.11-2.fc44 Β· GPL-2.0-or-later
- nixos 26.05: policycoreutils 3.11
- nixpkgs unstable: policycoreutils 3.11
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- ubuntu questing: policycoreutils 3.8.1-1
- ubuntu resolute: policycoreutils 3.9-2
- ubuntu stonking: policycoreutils 3.11-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms