[Lazarus] root privileg

SPRL AFOR aforsprl at gmail.com
Wed Jun 4 16:57:35 CEST 2014


Le 4/06/2014 16:54, Michael Van Canneyt a écrit :
>
>
> 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.
Like a service ?
OK, that's what I suspected. Thanks.

Antonio.
>
> Michael.
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com





More information about the Lazarus mailing list