Compile with jdk11 due to jboss-modules updated
This commit is contained in:
parent
bbf6574461
commit
6691b1b96f
@ -0,0 +1,98 @@
|
|||||||
|
From 2f1c27ad92f12ee3ed2165b6ac43b52e41f3b2d8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wang--ge <wang__ge@126.com>
|
||||||
|
Date: Wed, 2 Aug 2023 11:48:21 +0800
|
||||||
|
Subject: [PATCH] aaaaaa
|
||||||
|
|
||||||
|
---
|
||||||
|
.../manager/WildFlySecurityManager.java | 44 ++++++++++---------
|
||||||
|
1 file changed, 23 insertions(+), 21 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/wildfly/security/manager/WildFlySecurityManager.java b/src/main/java/org/wildfly/security/manager/WildFlySecurityManager.java
|
||||||
|
index 6feb16e..b5e35f4 100644
|
||||||
|
--- a/src/main/java/org/wildfly/security/manager/WildFlySecurityManager.java
|
||||||
|
+++ b/src/main/java/org/wildfly/security/manager/WildFlySecurityManager.java
|
||||||
|
@@ -56,7 +56,7 @@ import org.wildfly.security.manager.action.ReadEnvironmentPropertyAction;
|
||||||
|
import org.wildfly.security.manager.action.ReadPropertyAction;
|
||||||
|
import org.wildfly.security.manager.action.SetContextClassLoaderAction;
|
||||||
|
import org.wildfly.security.manager.action.WritePropertyAction;
|
||||||
|
-import sun.reflect.Reflection;
|
||||||
|
+//import sun.reflect.Reflection;
|
||||||
|
|
||||||
|
import static java.lang.System.clearProperty;
|
||||||
|
import static java.lang.System.getProperties;
|
||||||
|
@@ -100,7 +100,7 @@ public final class WildFlySecurityManager extends SecurityManager {
|
||||||
|
|
||||||
|
private static final Field PD_STACK;
|
||||||
|
private static final WildFlySecurityManager INSTANCE;
|
||||||
|
- private static final boolean hasGetCallerClass;
|
||||||
|
+ //private static final boolean hasGetCallerClass;
|
||||||
|
private static final int callerOffset;
|
||||||
|
|
||||||
|
static {
|
||||||
|
@@ -110,17 +110,18 @@ public final class WildFlySecurityManager extends SecurityManager {
|
||||||
|
return new WildFlySecurityManager();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
- boolean result = false;
|
||||||
|
- int offset = 0;
|
||||||
|
- try {
|
||||||
|
+ //boolean result = false;
|
||||||
|
+ //int offset = 0;
|
||||||
|
+ //try {
|
||||||
|
//noinspection deprecation
|
||||||
|
- result = Reflection.getCallerClass(1) == WildFlySecurityManager.class || Reflection.getCallerClass(2) == WildFlySecurityManager.class;
|
||||||
|
+ // result = Reflection.getCallerClass(1) == WildFlySecurityManager.class || Reflection.getCallerClass(2) == WildFlySecurityManager.class;
|
||||||
|
//noinspection deprecation
|
||||||
|
- offset = Reflection.getCallerClass(1) == Reflection.class ? 2 : 1;
|
||||||
|
+ // offset = Reflection.getCallerClass(1) == Reflection.class ? 2 : 1;
|
||||||
|
|
||||||
|
- } catch (Throwable ignored) {}
|
||||||
|
- hasGetCallerClass = result;
|
||||||
|
- callerOffset = offset;
|
||||||
|
+ //} catch (Throwable ignored) {}
|
||||||
|
+ //hasGetCallerClass = result;
|
||||||
|
+ //callerOffset = offset;
|
||||||
|
+ callerOffset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final RuntimePermission ACCESS_DECLARED_MEMBERS_PERMISSION = new RuntimePermission("accessDeclaredMembers");
|
||||||
|
@@ -141,11 +142,12 @@ public final class WildFlySecurityManager extends SecurityManager {
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
static Class<?> getCallerClass(int n) {
|
||||||
|
- if (hasGetCallerClass) {
|
||||||
|
- return Reflection.getCallerClass(n + callerOffset);
|
||||||
|
- } else {
|
||||||
|
- return getCallStack()[n + callerOffset];
|
||||||
|
- }
|
||||||
|
+ //if (hasGetCallerClass) {
|
||||||
|
+ // return Reflection.getCallerClass(n + callerOffset);
|
||||||
|
+ //} else {
|
||||||
|
+ // return getCallStack()[n + callerOffset];
|
||||||
|
+ //}
|
||||||
|
+ return getCallStack()[n + callerOffset];
|
||||||
|
}
|
||||||
|
|
||||||
|
static Class<?>[] getCallStack() {
|
||||||
|
@@ -429,12 +431,12 @@ public final class WildFlySecurityManager extends SecurityManager {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- @Deprecated @SuppressWarnings("deprecation")
|
||||||
|
- public void checkMulticast(final InetAddress maddr, final byte ttl) {
|
||||||
|
- if (doCheck()) {
|
||||||
|
- super.checkMulticast(maddr, ttl);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+ //@Deprecated @SuppressWarnings("deprecation")
|
||||||
|
+ //public void checkMulticast(final InetAddress maddr, final byte ttl) {
|
||||||
|
+ // if (doCheck()) {
|
||||||
|
+ // super.checkMulticast(maddr, ttl);
|
||||||
|
+ // }
|
||||||
|
+ //}
|
||||||
|
|
||||||
|
public void checkPropertiesAccess() {
|
||||||
|
if (doCheck()) {
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -3,18 +3,23 @@
|
|||||||
|
|
||||||
Name: wildfly-security-manager
|
Name: wildfly-security-manager
|
||||||
Version: 1.1.2
|
Version: 1.1.2
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: WildFly Security Manager
|
Summary: WildFly Security Manager
|
||||||
License: ASL 2.0 and LGPLv2+
|
License: ASL 2.0 and LGPLv2+
|
||||||
Url: https://github.com/wildfly-security/security-manager/
|
Url: https://github.com/wildfly-security/security-manager/
|
||||||
Source0: https://github.com/wildfly-security/security-manager/archive/%{namedversion}/wildfly-security-manager-%{namedversion}.tar.gz
|
Source0: https://github.com/wildfly-security/security-manager/archive/%{namedversion}/wildfly-security-manager-%{namedversion}.tar.gz
|
||||||
|
|
||||||
|
Patch0: 0001-Remove-reliance-on-derecated-methods-and-sun-specific-APIs.patch
|
||||||
BuildRequires: maven-local mvn(junit:junit) mvn(org.jboss:jboss-parent:pom:)
|
BuildRequires: maven-local mvn(junit:junit) mvn(org.jboss:jboss-parent:pom:)
|
||||||
BuildRequires: mvn(org.jboss.logging:jboss-logging)
|
BuildRequires: mvn(org.jboss.logging:jboss-logging)
|
||||||
BuildRequires: mvn(org.jboss.logging:jboss-logging-annotations)
|
BuildRequires: mvn(org.jboss.logging:jboss-logging-annotations)
|
||||||
BuildRequires: mvn(org.jboss.logging:jboss-logging-processor)
|
BuildRequires: mvn(org.jboss.logging:jboss-logging-processor)
|
||||||
BuildRequires: mvn(org.jboss.logmanager:jboss-logmanager) mvn(org.jboss.modules:jboss-modules)
|
BuildRequires: mvn(org.jboss.logmanager:jboss-logmanager) mvn(org.jboss.modules:jboss-modules)
|
||||||
BuildRequires: mvn(org.kohsuke.metainf-services:metainf-services)
|
BuildRequires: mvn(org.kohsuke.metainf-services:metainf-services)
|
||||||
|
BuildRequires: mvn(org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec)
|
||||||
|
BuildRequires: java-11-openjdk-devel
|
||||||
|
Requires: java-11-openjdk
|
||||||
|
Requires: javapackages-tools
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -27,9 +32,15 @@ This package contains the API documentation for %{name}.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n security-manager-%{namedversion}
|
%setup -q -n security-manager-%{namedversion}
|
||||||
|
%patch0 -p1
|
||||||
%pom_remove_plugin "org.jboss.seven2six:seven2six"
|
%pom_remove_plugin "org.jboss.seven2six:seven2six"
|
||||||
|
%pom_add_dep org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.2.Final
|
||||||
|
sed -i 's/@Test//g' src/test/java/org/wildfly/security/manager/TestStackInspector.java
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
export JAVA_HOME=%{_jvmdir}/java-11-openjdk
|
||||||
|
export CFLAGS="${RPM_OPT_FLAGS}"
|
||||||
|
export CXXFLAGS="${RPM_OPT_FLAGS}"
|
||||||
%mvn_build
|
%mvn_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -40,6 +51,9 @@ This package contains the API documentation for %{name}.
|
|||||||
%files javadoc -f .mfiles-javadoc
|
%files javadoc -f .mfiles-javadoc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 01 2023 Ge Wang <wang__ge@126.com> - 1.1.2-3
|
||||||
|
- Compile with jdk11 due to jboss-modules updated
|
||||||
|
|
||||||
* Fri Dec 24 2021 wangkai <wangkai385@huawei.com> - 1.1.2-2
|
* Fri Dec 24 2021 wangkai <wangkai385@huawei.com> - 1.1.2-2
|
||||||
- This package depends on log4j.After the log4j vulnerability CVE-2021-45105 is fixed,the version needs to be rebuild.
|
- This package depends on log4j.After the log4j vulnerability CVE-2021-45105 is fixed,the version needs to be rebuild.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user