News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Execute programs with sudo rights in ubuntu.

Started by lilezek, April 04, 2011, 04:07:29 PM

Previous topic - Next topic

lilezek

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.

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: oBFusCATed on April 04, 2011, 04:50:52 PM
This http://forums.next.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).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

A script probably won't work, because C::B needs the PID of GDB.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: oBFusCATed on April 04, 2011, 08:57:01 PM
A script probably won't work, because C::B needs the PID of GDB.
...true. :oops:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

lilezek

Quote from: oBFusCATed on April 04, 2011, 04:50:52 PM
This http://forums.next.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.

oBFusCATed

Install windows then. There is no such restriction  :lol:
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

Quote from: oBFusCATed on April 06, 2011, 03:34:19 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.

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

lilezek

Quote from: oBFusCATed on April 06, 2011, 03:34:19 PM
Install windows then. There is no such restriction  :lol:

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