0

I want to run a child process with subprocess.Popen and the application reads a config file.

The application connects to a database. Before I run the application I create an ssh tunnel and overwrite his config file to connect to the tunnel. (I run /path/to/application/app.exe and the application config is /path/to/application/app.ini) But I dont want the user be able to read the config file. (user and password to the database)

Can I run the child process in a "sandbox" that when it wants to read the /path/to/application/app.ini the parrent process will put an own virtual config file?

microo8
  • 3,568
  • 5
  • 37
  • 67
  • Is this on Windows? Please specify the exact platform - solutions to this kind of problem tend to be very platform-dependent. – user4815162342 Jun 02 '14 at 09:44
  • Yes I want it to run just on Windows. – microo8 Jun 02 '14 at 09:46
  • 1
    Can the application be modified to optionally read the configuration from standard input (e.g. if given `-` or similar magic value for configuration file name)? Then you could use the standard `subprocess` features for writing to a subprocess pipes, which work on Windows just fine. This communication is language-independent and is normally invisible to non-privileged third-party observers. – user4815162342 Jun 02 '14 at 09:53
  • What control do you have on `app.exe` (i.e. : can you alter source and recompile it) ? And where will parent app find user and password in a way not readable by user ? – Serge Ballesta Jun 02 '14 at 10:17
  • the `app.exe` can be edited, Im working on the subprocess pipes and reading the config from stdin. The parent app is communicating with a server that sends the needed authentication data. – microo8 Jun 02 '14 at 10:33

0 Answers0