ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Java vs. .NET Security, Part 1
Subject:   Here is a run file for unix
Date:   2004-03-10 01:24:53
From:   mzarathustra

# same behavior in linux

echo --- Intruder.java ---
cat Intruder.java
echo --- VictimPublic.java ---
cat VictimPublic.java
echo --- VictimPrivate.java ---
cat VictimPrivate.java
echo ""

rm -f *.class
cp VictimPublic.java Victim.java
javac Intruder.java

echo "--- calling public Victim.assault()"
java Intruder
echo ""

echo "--- calling private Victim.assault()"
rm Victim.*
cp VictimPrivate.java Victim.java
javac Victim.java
java Intruder

echo "Calling private version of Victim.assault() with verification"
java -verify Intruder