On 17 May 2014 06:53, Charl Wentzel <charl.went...@vodamail.co.za> wrote:
> On 17/05/2014 01:35, Dimitri John Ledkov wrote:
>
>> On 16 May 2014 07:26, Charl Wentzel <charl.went...@vodamail.co.za> wrote:
>
>>> I wanted do to debugging in Eclipse which required me to let Eclipse run
>>> gdb with sudo.  However, for this to work, sudo must not ask for a
>>> password.  So I've added the following entry in /etc/sudoers under the
>>> appropriate comment:
>
>> If you simply want to grant unrestricted permissions for gdb to attach
>> to any process, you don't need to grant full sudo to it.
>
> Thanks, I'll have a look into it.
>
>> Are there any other reasons why you want to run gdb as root from eclipse?
>
> Yes, I'm writing an application that works with /dev/port for setting IO
> states.  I've looked into a few options, but none of the quite suited me:
>

Whilst coding you may want to open up /dev/port, e.g.
$ sudo chmod g+w /dev/port # if you need r/w access
$ sudo adduser `id -un` kmem
(re-login)

This will open up /dev/port for r+w to yourself (well anyone in kmem
group). This is slightly better than running things as root.

However, you'll need a solution to do something sensible in the
finally shipped application. E.g. do start your application as root
(or use setuid on the binary), execute ioperm()/iopl() to grant access
to I/O ports you need, and after that drop privileges. For more info
see http://www.tldp.org/HOWTO/IO-Port-Programming-2.html

This discussion is already out of scope for this mailing list however
=) as we are getting in the realm of just generic linux/unix
programming, more suited for something like stackoverflow / linux-unix
stackexchange and the like.

-- 
Regards,

Dimitri.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to