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


Click here to return to the 'Create a 'one-time-use' root-enabled GUI Finder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a 'one-time-use' root-enabled GUI Finder
Authored by: rspeed on Nov 02, '04 11:49:24AM

Though I agree it is a bad idea, in this case that would not be true. The Finder running as root would use /var/root/ as it's home folder and therefore would not interfere.



[ Reply to This | # ]
The real deal on sudo and preferences
Authored by: ahruman on Nov 03, '04 10:48:25AM

As it happens, you're both wrong. Sudo passes all environment variables, including $HOME, to the process it launches. This means that the new Finder process will use the home folder of the user who typed the sudo command. However, the preferences file is accessed through a system library (using NSUserDefaults or CFPreferences), which ensures preferences file is not corrupted (it will contain the preferences as understood to the last application that wrote to it) and that its owner is not changed.

A couple of other notes: if you leave the sudoed Finder running, you can kill it as follows:
% sudo ps -x
(Find the pid of the Finder in the list, e.g. 642)
% sudo kill 642

Also, the password you give to sudo is not "your root password", as the article says, but your normal password. This only works if your account has sudo privileges, which usually means an administrator account.

Incidentally, if you're not logged in with admin priviledges, you can:
% login youradminaccount
password: [your admin password]
% sudo whatever
Password: [your admin password, again]

In this case, if "whatever" is the finder, it will run with youradminaccount's preferences.



[ Reply to This | # ]