Most of the other questions about this seem to be C related. I am using Free Pascal and the Lazarus IDE, version 2.4.0 and 0.9.30 respectively.
I am creating a GUI that calls and passes arguments to a Linux command. I don't want my users to have to run the whole GUI using sudo\root, but rather be prompted for the password at the appropriate time.
I am using TProcess
to call the Linux commands and pass and read values. I can't work out, though, how to pass the sudo
password to the command from my own program?
To give an example, take the following normal command line:
dd if=/dev/hda1 of=~/image.dd
Enter sudo password:
My program is calling dd
, passing it the if
and of
values from a GUI interface - it then needs to gather and pass the sudo
password to dd
.