When trying to add a new file context (for sun-jdk) the specific file context information was being ignored and all files under /opt were being labeled system_u:object_r:opt_t This is because the opt directory was labeled with program/opt.fc which was placed after the java.fc in the file_contexts. Therefore the last one to precedence. Reproducible: Always Steps to Reproduce: 1. Add a new file context that tries to relabel a subdirectory in opt 2. make relabel 3. ls -Z /opt Actual Results: All subdirectories still are labeled opt_t Expected Results: subdirectories should be labeled with more specific labeling that was specified in my fc file. The problem can be fixed by moving the contents of domains/programs/opt.te and file_contexts/programs/opt.fc into types/file.te and file_contexts/types.fc respectively. More specifically add to file.te # # opt_t # type opt_t, file_type, root_dir_type, sysadmfile; and add to types.fc # # /opt # /opt(/.*)? system_u:object_r:opt_t /opt/bin(/.*)? system_u:object_r:bin_t Portage 2.0.50-r1 (selinux-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.24-selinux-r2) ================================================================= System uname: 2.4.24-selinux-r2 i686 Pentium III (Coppermine) Gentoo Base System version 1.4.3.13 Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.7.7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer" CHOST="i386-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="berkdb crypt java ncurses pam perl python readline selinux ssl tcpd x86 zlib"
opt.te/fc is going to be removed, relabeling opt to usr_t.