User forums > General (but related to Code::Blocks)

A constructive suggestion

(1/2) > >>

198710:
I'm currently developing a raw socket program under Ubuntu,but this kind of programs need administrator's privilege that can only run with "sudo" command.Since switching to root user is not that easy in Ubuntu,I wish CodeBlocks can provide a dialogbox with a single line textbox for password to access the superior privilege for such programs. :)

MortenMacFly:

--- Quote from: 198710 on December 26, 2009, 02:36:06 pm ---CodeBlocks can provide a dialogbox with a single line textbox for password to access the superior privilege for such programs. :)

--- End quote ---
You can use the tools menu for that easily. Setup SUDO as a tool using the macros for current project / target / executable and you're done. It'll work with any project you setup.

198710:
Nice answer and thanks a lot!
But I also wish to know how to "debug" such programs with root's privilege?

MortenMacFly:

--- Quote from: 198710 on December 27, 2009, 04:09:36 am ---But I also wish to know how to "debug" such programs with root's privilege?

--- End quote ---
If you are constantly need this you can modify the shell command from the settings and prepend a sudo in front. (Never tried that, but it should work.)

Alternatively why don't you simply start an instance of C::B itdelf with root rights? I know this might be a security risk, but as a developer you should know what to do... ;-) Notice that it's possible to habe e.g. one instance with root rights and another with default rights (in case you'll need this). Make sure you setup the multiple instance handling in the general settings correctly for this to work.

198710:
Wonderful idea!
But I discovered another approximately perfect solution:
"Remote" debug with 127.0.0.1 and say "sudo" before gdbserver 8)
What's unfortunate is that the raw socket detects the gdbserver connection recursively!

Navigation

[0] Message Index

[#] Next page

Go to full version