1

I have a Java program that writes some files to /tmp and invokes some python processes. I'm wondering if both the Java program and the python processes have the same permissions as the user that originally executed the Java program?

Also, would the python processes be able to delete the files written by the Java program?

1

In general, an program or script should run with the permissions of the process that started it, so as long as you don't have the setuid flag set on the python scripts, they should run as the same user as the Java program.

This means the python scripts should be able to delete the files created by the Java program. Of course, if the Java program still has the files open at the time, you will run into problems.

2
  • Thanks! Quick follow-up question, how does JVM/interpreters fit into this picture? Suppose that the JVM was started by one user, and another user executes the bytecode, how is permission defined here? Or does that even make sense? (I'm not familiar with Java)
    – Max
    Sep 24 '14 at 18:14
  • @Max I am pretty sure that doesn't make sense.
    – lzam
    Sep 24 '14 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.