Workplace Widget 5.10.23
This commit is contained in:
28
hmi-scripts/test-jaas-identity.sh
Normal file
28
hmi-scripts/test-jaas-identity.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
"$ROOT/hmi-scripts/build-jaas-bridge.sh"
|
||||
TEMP="$(mktemp -d)"
|
||||
trap 'rm -rf "$TEMP"' EXIT
|
||||
cat >"$TEMP/JaasIdentityBridgeProbe.java" <<'JAVA'
|
||||
import com.widgetworkbench.cheerpj.JaasIdentityBridge;
|
||||
import com.sun.security.auth.module.UnixSystem;
|
||||
public class JaasIdentityBridgeProbe {
|
||||
public static void main(String[] args) {
|
||||
UnixSystem system = new UnixSystem();
|
||||
String user = JaasIdentityBridge.populate(system);
|
||||
if (!"cheerpj-client".equals(user)
|
||||
|| !user.equals(system.getUsername())
|
||||
|| system.getUid() != 65534L
|
||||
|| system.getGid() != 65534L
|
||||
|| system.getGroups().length != 0) {
|
||||
throw new AssertionError("Virtual Unix identity incomplete");
|
||||
}
|
||||
System.out.println("JAVA 11 JAAS BRIDGE: OK (virtual OS identity only)");
|
||||
}
|
||||
}
|
||||
JAVA
|
||||
JAR="$ROOT/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar"
|
||||
javac --release 11 -cp "$JAR" -d "$TEMP" "$TEMP/JaasIdentityBridgeProbe.java"
|
||||
java -cp "$TEMP:$JAR" JaasIdentityBridgeProbe
|
||||
node "$ROOT/hmi-frontend/tests/cheerpj-jaas-native.mjs"
|
||||
Reference in New Issue
Block a user