Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: lilezek on April 04, 2011, 04:07:29 pm

Title: Execute programs with sudo rights in ubuntu.
Post by: lilezek on April 04, 2011, 04:07:29 pm
Hi. I'm doing a program that needs super user rights to work. So I need to build it and then execute it as sudo user.

How could I execute a debugger within code::blocks with super user rights? Could this be done without execute code::blocks as super user?

Thank you.
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: oBFusCATed on April 04, 2011, 04:50:52 pm
This http://forums.codeblocks.org/index.php/topic,9775.0.html like the only solution at the moment.
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: MortenMacFly on April 04, 2011, 08:11:35 pm
This http://forums.codeblocks.org/index.php/topic,9775.0.html like the only solution at the moment.
Alternatively you can setup a script for gdb that actually calls sudo and queries for a PW in an intelligent way (not stopping C::B from work).
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: oBFusCATed on April 04, 2011, 08:57:01 pm
A script probably won't work, because C::B needs the PID of GDB.
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: MortenMacFly on April 04, 2011, 10:17:34 pm
A script probably won't work, because C::B needs the PID of GDB.
...true. :oops:
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: lilezek on April 06, 2011, 03:24:57 pm
This http://forums.codeblocks.org/index.php/topic,9775.0.html like the only solution at the moment.

Well, I already know that solution, that is why I asked a way to do it without sudo privileges. I don't like my source code or my the compiled objects to be owned by root user.
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: oBFusCATed on April 06, 2011, 03:34:19 pm
Install windows then. There is no such restriction  :lol:
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: Jenna on April 06, 2011, 03:57:29 pm
Install windows then. There is no such restriction  :lol:
There is something similar, as we often see, if users try to create exe's below win7's program-folder.
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: oBFusCATed on April 06, 2011, 05:23:51 pm
I should have left it win98...  :lol:
Title: Re: Execute programs with sudo rights in ubuntu.
Post by: lilezek on April 06, 2011, 06:07:38 pm
Install windows then. There is no such restriction  :lol:

No restriction for reading memory with ReadProcessMemory and WriteProcessMemory? It sounds security hazard.