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.
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)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다