Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/reproducers/6657133/Test.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.sun.imageio.plugins.jpeg;

import java.security.AccessControlException;

public
Expand Down
19 changes: 14 additions & 5 deletions test/reproducers/6657133/Test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,25 @@ echo $PWD
FS="/"
JAVAC=${TESTJAVA}${FS}bin${FS}javac
JAVA=${TESTJAVA}${FS}bin${FS}java
if [ "x$TESTSRC" == "x" ] ; then
TESTSRC="."
fi

$JAVAC -d . $TESTSRC/Test.java
R=$?
if [[ $R -ne 0 ]] ; then
echo "On newer JDK compilationmust fail. OK - javacc returned $R"
exit 0
if [ "0$R" -ne "0" ] ; then
echo "On newer JDK default compilation must fail. OK - javac returned $R"
# ok, how new jdk?
if ! ${JAVA} -Djava.security.manager=allow -version | grep "Could not create SecurityManager" ; then
echo "jdk with no security manager, passing"
exit 0
else
echo "jdk with security manager, but no com.sun.imageio.plugins.jpeg.JPEG class"
exit 0
fi
fi

# older JDK, here the reproducer must verify field is unaccessible

$JAVA -Djava.security.manager Test
$JAVA -Djava.security.manager com.sun.imageio.plugins.jpeg.Test
R=$?
exit $R