[Lazarus] run program in ide with sudo for debug purpose

ik idokan at gmail.com
Sun Feb 26 14:56:19 CET 2012


On Sun, Feb 26, 2012 at 15:29, Mark Morgan Lloyd
<markMLl.lazarus at telemetry.co.uk> wrote:
> Martin wrote:
>>
>> On 26/02/2012 12:38, ik wrote:
>>>
>>> Hello,
>>>
>>> I'm trying to debug a program that I'm writing with Lazarus, and it
>>> require root privileges, but I do not want Lazarus to run as root,
>>> only the program itself for debug.
>>>
>>> How can I do that ?
>>>
>>
>> I have not tried it, but maybe if you replace "/usr/bin/gdb" (in the IDE
>> opions dialog) with "sudo /usr/bin/gdb" ?
>>
>> Of course that affects all projects.
>>
>> But afaik you can't use a starter app , because then gdb will attempt to
>> debug the starter app....
>
>
> I've had this sort of requirement in the past, specifically when using
> libusb (i.e. the program needed sufficient privilege to grab the device).
>
> I wonder whether setting either Lazarus or gdb setuid root would help?

That's scars me a lot. Because it means that every program that is
using gdb can raise it's privileges to root.
I think that a better way, will be to set per project if the program
should have different privileges for running inside Lazarus, and if
so, then to use tools such as kdesu for example.

>
> --
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk
>
> [Opinions above are the author's, not those of his employers or colleagues]
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




More information about the Lazarus mailing list