6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
authorohair
Wed, 10 Sep 2008 10:19:02 -0700
changeset 1164 fcf7f66faf68
parent 1163 0de695c3558f
child 1165 4e62e945f4eb
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them Reviewed-by: tbell
jdk/make/common/Defs.gmk
--- a/jdk/make/common/Defs.gmk	Wed Sep 10 10:16:54 2008 -0700
+++ b/jdk/make/common/Defs.gmk	Wed Sep 10 10:19:02 2008 -0700
@@ -704,7 +704,20 @@
 # Install of imported file (JDK_IMPORT_PATH, or some other external location)
 define install-import-file
 @$(ECHO) "ASSEMBLY_IMPORT: $@"
-$(install-file)
+$(prep-target)
+$(CP) $< $@
+@if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then     \
+  if [ -x /usr/sbin/selinuxenabled ] ; then                         \
+    /usr/sbin/selinuxenabled;                                       \
+    if [ $$? = 0 ] ; then                                           \
+      $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@";               \
+      /usr/bin/chcon -t textrel_shlib_t $@;                         \
+      if [ $$? != 0 ]; then                                         \
+        echo "ERROR: Cannot chcon $@";                              \
+      fi;                                                           \
+    fi;                                                             \
+  fi;                                                               \
+fi
 endef
 
 .PHONY: all build clean clobber