Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Question regarding the PATH

Question regarding the PATH
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2005
Status: Offline
Reply With Quote
Oct 11, 2005, 11:41 PM
 
"Never put the current directory (specified by . (period)) in the PATH value specified for the root user. Never allow the current directory to be specified in /etc/profile. The root user should have its own PATH specification in his private .profile file "

Infos: Refer: http://publib.boulder.ibm.com/infoce...r_accounts.htm


My question is, what is actually the PATH is? what it keeps inside the PATH?
and what is the .profile?

So, based on the statement above(the blue colour font), can you rephrase the statement in easy way to understand?

Last question, is every user will have their own path?

Kind Regards,
     
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Oct 12, 2005, 01:43 AM
 
$PATH is a list of directories that are automatically searched for executables. For instance, if /bin is in your $PATH, then you can just type ls instead of /bin/ls when you want to run ls.

.profile is a file that contains settings for your shell. Your own personal settings would be kept in your home folder, so ~/.profile.

. means "this directory." They tell you not to put . in root's $PATH because if you do then it's easy to accidentally execute things that you might not want to execute. It's a security risk.

Each user can have a different $PATH if each user has different settings in ~/.profile or ~/.bashrc or other per-user configuration file. By default, all users should have the same $PATH.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 12, 2005, 02:36 AM
 
Basically, if you don't know what it's talking about, you aren't likely to disobey anyway.

It's talking about configuring your shell environment, and says that you should not put "." (shorthand for the directory you are currently in) in your PATH environment variable.

The basic reason is this: Normally, when you type "top" at the command line, it will go through your PATH and find /usr/bin/top. If you have "." in your PATH, and there is some program named "top" in the directory you're in, it will execute that program instead of /usr/bin/top, even though the latter is probably what you meant. This means that if some malicious program with the same name as a standard program is in the current directory, you run the risk of accidentally running it if "." is in your PATH.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:18 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2