Results 1 to 7 of 7

Thread: Does my applet can't have a Runtime()?

  1. #1

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Question Does my applet can't have a Runtime()?

    Can't i have this code in a applet?

    Code:
    public class runMe extends Applet
    {
    	public void init()
    	{
    		try
    			{
    				Runtime.getRuntime().exec("myProcedures.bat");
    			}
    		catch(Exception _ex)
    			{
    				System.out.println("ERROR!!!");
    			}
    
    	}
    	
    }
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    No. Security limitations.

    Well, you can have the code, but it will throw an exception.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    Hummmm i suposed it was cause of that...
    I'v tryed to bypass that but it's not possible, i need to find an other solution for this

    I had made once a bypass to the security and i made a applet that
    could read some txt files on the server.
    Maybe i can fin a solution for this too
    Thanks for your time
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    That's not bypassing. Establish network connections to the originating server is explicitely allowed.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    but isn't really any way to exec something in the server remotely using java?

    I don't want to install anything on my server, i just have a apache
    runing on it.
    what i'd like to do is to shutdown or reboot the server remotely,
    without going home all times i need to restart it.
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Well, you could have a privileged CGI script there that shuts down the server. You need to protect this quite well, though.

    Some problems arise:
    1) It must be a different server process than your main web server for security reasons: the server that hosts the CGI must stay root (unlike the normal, which binds to port 80 and then gives up root privileges), which is dangerous.
    2) It must have its own configuration (obviously).

    A better solution than writing an applet like this would be to use an existing remote administration package. There's one written in PHP at sourceforge.net, can't remember its name though. WebMin, I think.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    ahh...ok then! the php file should help a lot...as i have a apache server runing...
    Run as root is out of chance...no way i will do that.

    Thanks so much for your nice help!
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width