Discussion:
How can an external application disable the security manager?
mbesney
2012-03-01 22:25:53 UTC
Permalink
Hello,

Could someone please advise me on this?

I am using the robocode.control class to run Robocode from an external Java application. The external application is also using the java.awt.datatransfer class to place a string in the system clipboard as soon as a battle starts. I have an interactive robot that uses the java.awt.datatransfer class to read the string from the clipboard and display it in the robot console when the battle starts.

When I run the external application it places the string in the clipboard but the interactive robot is immediately banned from the battle due to its accessing the clipboard (i.e. security is on). So after this I run Robocode from the console with the security off (-DNOSECURITY=true) and the interactive robot reads the clipboard and displays the message.

So I know that external communication is possible, I just need to be able to turn off the security manager externally which none of the RobocodeEngine constructors seem capable of doing. I would really rather not modify the Robocode source code as I am a Robocode, Java, and open source rookie. If that's my only option, however, then I would go for it if I knew what files to change.

Any suggestions would be much appreciated,
Thank you,
Regards,

Mike




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Pavel Šavara
2012-03-02 00:09:07 UTC
Permalink
System.setProperty("NOSECURITY", "true")
Post by mbesney
**
Hello,
Could someone please advise me on this?
I am using the robocode.control class to run Robocode from an external
Java application. The external application is also using the
java.awt.datatransfer class to place a string in the system clipboard as
soon as a battle starts. I have an interactive robot that uses the
java.awt.datatransfer class to read the string from the clipboard and
display it in the robot console when the battle starts.
When I run the external application it places the string in the clipboard
but the interactive robot is immediately banned from the battle due to its
accessing the clipboard (i.e. security is on). So after this I run Robocode
from the console with the security off (-DNOSECURITY=true) and the
interactive robot reads the clipboard and displays the message.
So I know that external communication is possible, I just need to be able
to turn off the security manager externally which none of the
RobocodeEngine constructors seem capable of doing. I would really rather
not modify the Robocode source code as I am a Robocode, Java, and open
source rookie. If that's my only option, however, then I would go for it if
I knew what files to change.
Any suggestions would be much appreciated,
Thank you,
Regards,
Mike
Continue reading on narkive:
Loading...