Description of problem: oo-restorecon -v -a does not add selinux MCS labels to files under hidden directory example: .env/* Version-Release number of selected component (if applicable): v2.2.x How reproducible: 100% Steps to Reproduce: 1. mv /var/lib/openshift/<gearUUID> 2. lose selinux attributes 3. run oo-restorecon -v -a Actual results: # oo-restorecon -v -a chcon -l s0:c86,c118 -R /var/lib/openshift/55f8844b8d24b7a8e50000a8/* restorecon -R /var/lib/openshift/5602de3b8d24b7872c000878/ chcon -l s0:c82,c817 -R /var/lib/openshift/5602de3b8d24b7872c000878/* # ls -lhaRZ .env/ .env/: drwxr-x---. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 . drwxr-x---. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 .. -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 GEM_HOME -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 HISTFILE -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 HOME -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0:c82,c817 JAVA_OPTS_EXT -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 JENKINS_PASSWORD -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 JENKINS_URL -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 JENKINS_USERNAME -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 OPENSHIFT_APP_DNS -rw-r--r--. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 OPENSHIFT_APP_NAME -rw-r--r--. root 5602de3b8d24b7872c000878 .env/user_vars: drwxrwx---. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 . drwxr-x---. root 5602de3b8d24b7872c000878 system_u:object_r:openshift_var_lib_t:s0 .. Expected results: All attribute get restored. Additional info:
Haven't tested but this should hopefully help: https://github.com/openshift/origin-server/pull/6273
Verified this bug with openshift-origin-node-util-1.38.5.1-1.el6op.noarch, and PASS. # touch .env/bb # ll -Z .env/bb -rw-r--r--. root root unconfined_u:object_r:openshift_var_lib_t:s0 .env/bb # oo-restorecon -v -a restorecon -R /var/lib/openshift/jialiu-python33app-1/ chcon -l s0:c6,c673 -R /var/lib/openshift/jialiu-python33app-1/ # ll -Z .env/bb -rw-r--r--. root root unconfined_u:object_r:openshift_var_lib_t:s0:c6,c673 .env/bb
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-2666.html