tomcat, java.security and cptool
Windows, luminis 4.2.1
I'm trying to write a jsp page that will issue cptool commands, however I keep running into the java.security. I'm guessing that I could alter the catalina.policy file to allow the io to work, however I'm a little uncomfortable editing something I know so little about.
Have any of you done anything like this & have any comments or sugguestions?
Thanks,
Steve

Very complicated
I think you have to extract something from cp.jar, update it and then re-jar back
It might be possible to update the websecure.all.xml too
Derek
University of Leeds, UK
Easy with SSH / PHP
We've done a PHP based gui that will do this with SSH commands -> CPTOOL commands. With PHP we just kick off a shell_exec command... not familiar with JSP to know if you can do the same, but I'm sure you can.
Thanks!
I now have a basic page set up that uses cptool to reset a users password (using data retrieved from Banner). Derek, you made me realized that I needed to set up a separate context to get past the luminis security stuff. msavage, jsp has a similar command - Runtime.getRuntime().exec(cmd). Now I just need to supply a bit more security . . .
Steve
code and update ?
Steve,
Would you mind posting the final code and / or a how to ? I have to do this as well - (change password based on something external) and I was investigating a perl call to cptool to achieve this. I'm quite interested in how yo udid this with jsp.
-Jon
cptool cprc shell_exec
I remember trying something similar years ago. When using shell_exec or other "call system command" functions (I was using CFML at the time), how were you able to execute a command remotely while having access to the .cprc and other luminis variables like CP_ROOT?
Is your shell_exec/getRuntime actually calling a script on the server, that then sources .cprc so that cptool works?
Yes, that's correct
I'm sure there are better ways, but this is what worked for me. In the jsp page I call a dos bat file (we're on Windows) with a couple of arguments in variables - the user name and the new password:
<% String[] cmd = {"c://this.bat", formUname, woo } ;
try
{ Process proc = Runtime.getRuntime().exec(cmd);
}
catch (Throwable t)
{
t.printStackTrace();
}
%>
The dos bat file is calling a bash shell:
c://cygwin//bin//bash -c 'source c://cygwin//etc//profile; source c://luminis/.cprc; cptool set password %1 %2';
The 'woo' variable is the spriden_id in banner which is what we use for an initial password, retrieved using info entered by the user.
Sorry about my late reply, staff got a spring break this year at WNMU, and I've been at home with my 14 month old son!
Steve