[opencms-dev] execute command app line from opencms site

ruben malchow r_malchow at web.de
Fri Oct 27 15:56:16 CEST 2006



you coulod try it like described below. but beware ... you have to
be VERY careful with this. a user might be able to execute any
command with the permission of the user your appserver is running
under if you don't check what's being passed to the shell script.

.rm

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


    String command =  "/bin/ls";
    String arg1 = "-l" ;
    String arg2 = "-a" ;

    Process p = Runtime.exec(new String[] { command, arg1, arg2 } );
   
    boolean processExit=false;

    while (!processExit) {
       try {
          p.getExitValue();
          processExit=true;
       } catch (IllegalThreadStateException itse) {
          // not donw yet;
       }
    }



md at evoconcept.de schrieb:
> Hi Folks,
>
> sorry - as I'm ot a programmer this might be fairly easy for most of you.
>
> I need to gather some details with a form on my opencms site and use them to be executed on the server (small shell app with variables gathered on the site).
>
> Any hint where to find a howto would be appreciated.
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list