sudo in c?
Reznic Valery
Valery_Reznic at icomverse.com
Sun Jun 22 09:44:16 EDT 2003
When you use popen you can ONLY read from the command's stdout
or ONLY write to it's stdin.
I you want both of them (and may be stderr too) you need play with
fork/exec/dup call's.
This is not something sudo specific it's pretty general for all commands,
which needs both input and output.
If you can (and want ) configure sudo to run this command without password
prompt
you'll need only read output from the sudo, i.e. popen will work for you
Valery
More information about the sudo-users
mailing list