Hello,
I would like to capture the password request of a process (like passwd or smbpasswd, ...) from a C/c++ program. My idea was to use pipes, but they capture only the stdout/stdin, not the request itself (e.g. "Enter password for user tom:" is not captured by pipes).
In other words, my program needs to change an user password (previously typed into the program code) without any user interaction. It has to intercept any user prompt and then it inserts (automatically) the password, passing it to the passwd (or any other) process.
I realize that pipes works fine when they intercept "ls -l" output, but when a Unix command requests for a prompt, they don't work...
Please, could you help me?
