Re: MoreSCF1.0d3 and root privilege
Re: MoreSCF1.0d3 and root privilege
- Subject: Re: MoreSCF1.0d3 and root privilege
- From: "Marc Epard" <email@hidden>
- Date: Thu, 07 Feb 2002 08:47:38 -0600
>
This makes everything run as root. This is a bad idea security-wise
>
(for example, I wouldn't do it unless your Mac is behind a firewall),
>
but it will allow you to debug SCF code in CodeWarrior.
What I do is a little more involved, but it's more selective and doesn't
require enabling root logins. I log in as my normal account, then when I
want to debug something that needs to run as root, I:
1. Quit CodeWarrior if it is already running.
2. Open a Terminal window.
3. Type sudo -s and hit return. It asks for an admin password and then
gives root access for the rest of the Terminal session. You'll notice the
prompt changes to root# instead of the user you started with. This does not
require enabling the root account for normal logins.
4. Launch Codwarrior from the terminal session (all one command):
/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp
'/Development/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior
IDE 4.2.6' &
You can build this command (specify the path to your CodeWarrior) without
line breaks in a text editor and keep it somewhere you can easily copy and
paste into the terminal or drag it out as a text clipping ready to drag into
the Terminal window. The command runs LaunchCFMApp, telling it to load and
run CodeWarrior, a CFM application. The & on the end tells the Terminal
(shell, actually) not to wait for the app to complete. That way you can
enter more commands if you need to and can close the Terminal window when
you want and CodeWarrior will keep running.
Since the Terminal session is running as root, CodeWarrior will also be
running as root and when it launches gdb and your app for debugging, they'll
be running as root as well.
Since you didn't log in as root from the start, apps you launch normally
from the Finder will run under the user you logged in as. Only those apps
you launch directly and indirectly from that Terminal session will have root
access.
-Marc
Marc Epard
Netopia, Inc.
P.S. As an alternative to the Terminal window, you could use a BBEdit Shell
Worksheet. This works sort of like MPW and lets you select one or more
commands and hit enter to have them executed. This is very convenient,
though entering the password for sudo is a little tricky: you have to type
it, select it, and hit enter. The password will be visible in the document
and you need to remember to delete it when you are finished.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.