{"id":3130,"date":"2022-12-20T16:43:33","date_gmt":"2022-12-20T19:43:33","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/fixfiles-man8\/"},"modified":"2022-12-20T16:43:33","modified_gmt":"2022-12-20T19:43:33","slug":"fixfiles-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/fixfiles-man8\/","title":{"rendered":"fixfiles (man8)"},"content":{"rendered":"<h1 align=\"center\">fixfiles<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#ARGUMENTS\">ARGUMENTS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">fixfiles \u2212 fix file SELinux security contexts.<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fixfiles<\/b> <i>[\u2212v] [\u2212F] [-M] [\u2212f] relabel<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fixfiles<\/b> <i>[\u2212v] [\u2212F] { check | restore | verify } dir\/file &#8230;<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fixfiles<\/b> <i>[\u2212v] [\u2212F] [\u2212B | \u2212N time ] { check | restore | verify }<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fixfiles<\/b> <i>[\u2212v] [\u2212F] \u2212R rpmpackagename[,rpmpackagename&#8230;] { check | restore | verify }<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fixfiles<\/b> <i>[\u2212v] [\u2212F] \u2212C PREVIOUS_FILECONTEXT { check | restore | verify }<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fixfiles<\/b> <i>[-F] [-M] [-B] onboot<\/i><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page describes the <b>fixfiles<\/b> script.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This script is primarily used to correct the security context database (extended attributes) on filesystems.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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 option. You can use the \u2212R flag to use rpmpackages as an alternative. The file \/etc\/selinux\/fixfiles_exclude_dirs can contain a list of directories excluded from relabeling.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fixfiles onboot<\/b> will setup the machine to relabel on the next reboot.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><b>\u2212B<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">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.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212F<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Force reset of context to match file_context for customizable files<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212f<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Clear \/tmp directory with out prompt for removal.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>\u2212R rpmpackagename[,rpmpackagename&#8230;]<\/b><\/p>\n<p style=\"margin-left:22%;\">Use the rpm database to discover all files within the specified packages and restore the file contexts.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212C PREVIOUS_FILECONTEXT<\/b><\/p>\n<p style=\"margin-left:22%;\">Run a diff on the PREVIOUS_FILECONTEXT file to the currently installed one, and restore the context of all affected files.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212N time<\/b><\/p>\n<p style=\"margin-left:22%;\">Only act on files created after the specified date. Date must be specified in &#8220;YYYY\u2212MM\u2212DD HH:MM&#8221; format. Date field will be passed to find \u2212\u2212newermt command.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212M<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Bind mount filesystems before relabeling them, this allows fixing the context of files or directories that have been mounted over.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-v<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Modify verbosity from progress to verbose. (Run restorecon with \u2212v instead of \u2212p)<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>ARGUMENTS <a name=\"ARGUMENTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">One of:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p style=\"margin-top: 1em\"><b>check<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">print any incorrect file context labels, showing old and new context, but do not change them.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>restore<\/b><\/p>\n<p style=\"margin-left:22%;\">change any incorrect file context labels.<\/p>\n<p style=\"margin-left:11%;\"><b>relabel<\/b><\/p>\n<p style=\"margin-left:22%;\">Prompt for removal of contents of \/tmp directory and then change any incorrect file context labels to match the install file_contexts file.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>verify<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>List out files with incorrect file context labels, but do not change them.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>[[dir\/file] &#8230; ]<\/b><\/p>\n<p style=\"margin-left:22%;\">List of files or directories trees that you wish to check file context on.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This man page was written by Richard Hally <rhally@mindspring.com>. The script was written by Dan Walsh <dwalsh@redhat.com><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>setfiles<\/b>(8), <b>restorecon<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  fixfiles \u2212 fix file SELinux security contexts. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,275,4],"class_list":["post-3130","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-fixfiles","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3130"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3130\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}