2

Ok, so I have some code that consists of two processes: (a) a parent/ launcher process, (b) a child process. (a) has a password that it needs to safely pass to (b). For reasons I won't go into here, I can't pass the password by opening a pipe between the two. I'm considering having (a) create a modified environment for (b) (using the env argument here, FWIW) that contains a password environment variable. My hope is that this environment variable with the password will not be accessible outside the context of process (b). Is that correct?

Ideally I need to have this be secure on both Linux and Unix systems.

6

My hope os that this environment variable with the password will not be accessible outside the context of process (b). Is that correct?

No, you should not rely on this. For example, on Linux, a process run by the same user can have access to your environment through /proc/<pid>/environ

Try:

tr '\0' '\n' < /proc/$$/environ

(or with the PID of any of your processes)

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.