Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rate Thread Display Modes
Old 05-28-2003, 08:53 AM   #1
anjan
Triple-A Player
 
Join Date: Apr 2003
Posts: 66
setting the path

Hi,
I have a package installed in my Desktop folder. However the commands in the package have to be specified as ./command. Which probably means that I need to add the package to the PATH name. How do I about changing the pathname and more importantly in which file do I change the pathname? Tried changing the csh.login but wasnot allowed to.

Will appreciate any input.

Thanks.

Anjan
__________________
ANJAN PURKAYASTHA
anjan is offline   Reply With Quote
Old 05-28-2003, 09:23 AM   #2
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
Rather than adding your Desktop Folder to your path, you might want to consider putting this "package" someplace more approriate for a UNIX file system.. someplace like /usr/local/bin/. Of course, then you have do add that to your path. I use a .login (stored in your home directory, it is invoked each time you open a new shell) to change my path. Just coppy /etc/csh.login to your home directory and call it .login. Here is my .login:
Code:
setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/sw/bin:/sw/sbin:/usr/X11R6/bin"
yellow is offline   Reply With Quote
Old 05-28-2003, 09:44 AM   #3
anjan
Triple-A Player
 
Join Date: Apr 2003
Posts: 66
Talking thanks

Thanks yellow , that worked fine. My question. Now the computer has two .login files : one in /etc dir and one in my home directory. Will that screw things up?

Anjan
__________________
ANJAN PURKAYASTHA
anjan is offline   Reply With Quote
Old 05-28-2003, 09:49 AM   #4
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
Nope.. by default it'll look at your home directory first and ignore anything else. If nothing exists there, it goes to the global .login in /etc
yellow is offline   Reply With Quote
Old 05-28-2003, 09:53 AM   #5
anjan
Triple-A Player
 
Join Date: Apr 2003
Posts: 66
thank you once again.
__________________
ANJAN PURKAYASTHA
anjan is offline   Reply With Quote
Old 05-28-2003, 08:41 PM   #6
java_guy
Major Leaguer
 
Join Date: Jan 2003
Location: Portland, OR
Posts: 288
You can also add . to your path which basically allows you to run things that are in your current working directory.

example:
if you had to do this before....

./someScript.sh

you can simply do
somScript.sh

after you add . to your path.
java_guy is offline   Reply With Quote
Old 05-28-2003, 08:47 PM   #7
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
a dot in the path is ill-advised; a known security exploitation.

explicit directories in the path, please.
__________________
On a clear disk, you can seek forever.
mervTormel is offline   Reply With Quote
Old 05-29-2003, 11:12 AM   #8
java_guy
Major Leaguer
 
Join Date: Jan 2003
Location: Portland, OR
Posts: 288
Merv,
Can you elaborate? First I've heard of adding . being a security risk.
java_guy is offline   Reply With Quote
Old 05-29-2003, 11:48 AM   #9
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
trojan horse

see sidebar "Stealing Superuser" in section "4.3.5 Using su with Caution":

http://www.soldierx.com/books/networ...is/ch04_03.htm

4.3.5 references chapter 11, and in the book here, "PATH attacks" (missing from the online version) urges all accounts to be wary of this PATH exploit by not having empty (::) or current dir (:.:) in the path.
__________________
On a clear disk, you can seek forever.
mervTormel is offline   Reply With Quote
Old 05-29-2003, 01:42 PM   #10
java_guy
Major Leaguer
 
Join Date: Jan 2003
Location: Portland, OR
Posts: 288
Cool. Thanks!
java_guy is offline   Reply With Quote
Reply


Posting 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

Forum Jump



All times are GMT -5. The time now is 06:12 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.