Restricting directory access of a Process created using System.exec(..)

A

ajay.todimala

Folks,

I am writing a Java application to execute a program (C++/Java) by
using System.exec method.

Is it possible to restrict the process (that is created using
System.exec(...) method) that is executing
the program to grant access permissions (like read, write, execute, )
to only a particular directory
and revoke all access permissions to all other directories and files.

Please let me know if it is possible. If so how?
Thanks in advance,
Ajay.
 
G

Gordon Beaton

I am writing a Java application to execute a program (C++/Java) by
using System.exec method.

Is it possible to restrict the process (that is created using
System.exec(...) method) that is executing the program to grant
access permissions (like read, write, execute, ) to only a
particular directory and revoke all access permissions to all other
directories and files.

Please let me know if it is possible. If so how?

Your question really has nothing to do with Java, and everything to do
with the operating system you use (which you neglected to specify).

Assuming a Unix-like system, you can do it with chroot, although you
might need to be root.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top