On Wed, 4 Jun 2014, A. Fortuny wrote:
Hi Folks.
How to gain temporarily root privileges in a pascal program ?
I need to 'ping' an IP address and for ping to work (Indy 10) I need to be
root.
Usage of another TCP component is not an option.
Another way is to execute a shell and intertpret the results but I'd to avoid
it if possible.
It is on Linux system.
You can't do this. Strictly forbidden.
The usual way to do this is to make the program setuid root, do the ping, and
then setuid() to some normal user ASAP.
If you need to do it at regular intervals, then you must execute a separate
program.
Michael.
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus