Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't execute Xuggle programs using different users #9

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

Can't execute Xuggle programs using different users #9

mbertini opened this issue Dec 7, 2012 · 0 comments

Comments

@mbertini
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant