mnky4a6 / javasnoop

Automatically exported from code.google.com/p/javasnoop
0 stars 0 forks source link

Wrong separator in AgentJarCreators classpath definition #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run javasnoop on Linux in a testing environment

What is the expected output? What do you see instead?

Javasnoop will fail to create, load and store the agents javasnoop.jar 

What version of the product are you using? On what operating system?

Linux - ubuntu 64bit

Please provide any additional information below.

The CLASSPATH separator character is platform dependent...

Original issue reported on code.google.com by mirco.ri...@email.de on 2 Mar 2011 at 11:43

GoogleCodeExporter commented 9 years ago
In addition there was a bug in class AgentJarCreator.java:
...
        // step #2: unzip the jar we're using right now to modify
        String tmpDir = null;
        if ( testing ) {
            tmpDir = System.getProperty("java.io.tmpdir") + RandomUtil.randomString(10);
        } else {
            tmpDir = new File(file).getParent() + File.separator + "working";
        }
...
that must be:

        // step #2: unzip the jar we're using right now to modify
        String tmpDir = null;
        if ( testing ) {
            tmpDir = System.getProperty("java.io.tmpdir") + File.separator + RandomUtil.randomString(10);
        } else {
            tmpDir = new File(file).getParent() + File.separator + "working";
        }

==================================

without the additional file seperator, on linux the result would be thatjava 
snoop tries to save the file on the root directory and that is not allowed for 
not superusers

Original comment by mirco.ri...@email.de on 2 Mar 2011 at 11:54

GoogleCodeExporter commented 9 years ago

Original comment by arshan.d...@gmail.com on 17 Mar 2011 at 2:18