Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Why not just sudo?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why not just sudo?
Authored by: nullprogram on Nov 17, '01 11:37:59AM
If you need to run some Aqua app as root, just use sudo appname!

ie: sudo open /Developer/Applications/PropertyListEditor.app

[ Reply to This | # ]
Doesn't work...
Authored by: robg on Nov 17, '01 12:17:04PM

As of the Security Update, 'sudo open' no longer opens the GUI apps as root. I just tried it again to make sure, and while you can open the Localizable Strings file, you won't be able to save the changes. Pseudo works around this limitation.

I'm not aware of another means of doing this from a shell ... anyone?

-rob.



[ Reply to This | # ]
Re: Doesn't work...
Authored by: saint.duo on Nov 17, '01 12:41:28PM

the only way I would know how would be to enable the root account, "su" up to root from the terminal, and open property list editor from there.



[ Reply to This | # ]
Re: Doesn't work...
Authored by: nullprogram on Nov 18, '01 04:30:28AM
Even using su - failes to open gui apps as root. open seems to be the cause. You have to run the executable in the MacOS folder in the package to open it as root.

[ Reply to This | # ]
Doesn't work...
Authored by: vajonez on Nov 17, '01 05:02:05PM
Alternatively, you could simply change the permissions of the file. It starts out as owned by user "root" and group "wheel" with a permissions mode of 644 (rw-r--r--). All you need to do is give the group write permission with:

   sudo chmod g+w <path_to>/Localizable.strings

where <path_to> is replaced by the actual path to the file mentioned in the article.

Now simply open the file with the property list editor and save it. No need to change the owner or run the editor as root.

AFAIK all admin users (i.e., ones that can use sudo) are in the "wheel" group.

[ Reply to This | # ]
Doesn't work...
Authored by: GaelicWizard on Oct 07, '02 06:54:39PM

FYI, only users in the admin group, not the wheel group, can use sudo, but it doesn't matter b/c sysprefs automatically adds admin users to both groups. :)



[ Reply to This | # ]
FIXED: Why not just sudo?
Authored by: nullprogram on Nov 18, '01 04:26:48AM
sudo /Developer/Applications/PropertyListEditor.app/Contents/MacOS/PropertyListEditor "/System/Library/CoreServices/Menu Extras/Clock.menu/Contents/Resources/English.lproj/Localizable.strings"



This works. I'm working on a free script called sopen that will replace sudo open. It will re-introduce the old sudo open security issues, but at least you will know that it is insecure when you use it.

[ Reply to This | # ]