tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "andy wix" <>
Subject RE: Runtime.exec security issue?
Date Tue, 30 Nov 2004 10:17:52 GMT
Any further thoughts on this issue?  There must be some reason why this 
won't run under Tomcat but does work stand-alone.

To recap, I am trying to execute the following code on an Xp box with Tomcat 

Process proc = runtime.exec("cmd.exe /C shutdown -r -f -m \\myPC -t 50");
int exitVal = proc.waitFor();

When this runs the proc exits with a value of 0 but nothing happens (no 
re-boot) and no exceptions are thrown.

I have tried running the code from a batch file and without the cmd.exe /C 

I have tried running Tomcat from the command line (not as service).

I have tried allowing all permissions in the catalina.policy file:
grant codeBase "file:${catalina.home}/webapps/ROOT/WEB-INF/classes/-" {
    permission "*";

I CAN successfully set the the system time and date using the same approach

I am truly flummoxed!


Express yourself with cool new emoticons

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message