- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: "." in Path
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 07:44 AM
04-20-2006 07:44 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 07:50 AM
04-20-2006 07:50 AM
SolutionIf "." is included in your PATH, it should be the last entry. "." should NEVER appear anywhere in root's PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 07:54 AM
04-20-2006 07:54 AM
Re: "." in Path
Don't *ever* do this for root. Don't do it period.
The implication is that anyone who can deposit malicious code into your directory can have it run without you being aware that you aren't running what you think!
Consider:
I place a piece of code named "date" in your home directory. The code does: "cd $HOME && rm -rf *".
Now you do:
$ date
You think you are running the real 'date' command, but you really just eliminated all your files.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 08:03 AM
04-20-2006 08:03 AM
Re: "." in Path
The dot in the path pretty much lets the path be redirected to the current directory.
Any system command can be replaced by a local, malicious copy.
It is like openning the barn door and inviting the horse theives in.
As noted, never for root, try and avoid it for users as well.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 09:10 AM
04-20-2006 09:10 AM
Re: "." in Path
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1003550
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 12:38 PM
04-20-2006 12:38 PM
Re: "." in Path
If the last character in $PATH is :, it's the same as :.: and if two adjacent :: are in $PATH, it means :.: This is a common error caused by editing /etc/PATH or bad install scripts. As mentioned, the current working directory (seen by the pwd command) should always be assumed to be suspect. In fact, some sysadmins learned that the way to run a program is to cd to the directory and then type the command name (leftover from bad DOS habits or terrible Unix for Beginners classes). My humble opinion is that . (the current working directory) should never be in any user's PATH -- but then I'm paranoid about security...
$PATH can be a severe security risk for users, and especially for the root superuser. The file /etc/PATH establishes a default set of paths to look for executazbles but it often turns into a massive list of possibile locations, often due to application installers. I take the approach that $PATH should be short and limited to the common requirements for normal users. Perhaps something like:
PATH=/usr/bin:/usr/contrib/bin
Now if a specific user wants a few more default locations, then add them to .profile for that one user.
root's PATH should be very different and more restrictive than user PATH values.
Bill Hassell, sysadmin