Can't execute Xuggle programs using different users #9

Open
mbertini opened this Issue Dec 7, 2012 · 0 comments

Comments

Projects
None yet
1 participant

mbertini commented Dec 7, 2012

What steps will reproduce the problem?

  1. create a Xuggle-based program on a *nix machine
  2. check that /tmp/xuggle directory is created. At the end of the execution of the program it should e empty (because of https://github.com/xuggle/xuggle-xuggler/blob/master/src/com/xuggle/ferry/JNILibrary.java - private static void deleteTemporaryFiles())
  3. execute the program with a different user (not root!).

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

Expected output is that the program works again. The outcome is "ERROR ~ could not create temp file: {}
java.io.IOException: Permission denied". See http://stackoverflow.com/questions/10449799/java-io-ioexception-permission-denied-with-xuggle#comment18861705_10466550

What operating system and JVM version are you using.

Ubuntu 11.04 with OpenJDK 1.6 and Sun JDK 1.6

Possible solution:
In JNILibrary.java there's the method:

private static File getTmpDir() {
File tmpdir = new File(System.getProperty("java.io.tmpdir"));
File xuggledir = new File(tmpdir, "xuggle");
xuggledir.mkdirs();
return xuggledir.exists() ? xuggledir : tmpdir;
}

that creates the temp directory where native libraries are temporarily decompressed. Unluckily the directory where they are decompressed is the same for all. In a multiuser system where a Xuggle-based program may be used by different users this creates problems since the second user does not have rights to write in the directory.
It should be enough to change:

File xuggledir = new File(tmpdir, "xuggle"); with something like: http://www.java2s.com/Tutorial/Java/0180__File/Createsanewandemptydirectoryinthedefaulttempdirectoryusingthegivenprefix.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment