The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   setting the path (http://hintsforums.macworld.com/showthread.php?t=12163)

anjan 05-28-2003 08:53 AM

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

yellow 05-28-2003 09:23 AM

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"

anjan 05-28-2003 09:44 AM

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:D

yellow 05-28-2003 09:49 AM

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

anjan 05-28-2003 09:53 AM

thank you once again.
:D :D :D :D :D

java_guy 05-28-2003 08:41 PM

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.

mervTormel 05-28-2003 08:47 PM

a dot in the path is ill-advised; a known security exploitation.

explicit directories in the path, please.

java_guy 05-29-2003 11:12 AM

Merv,
Can you elaborate? First I've heard of adding . being a security risk.

mervTormel 05-29-2003 11:48 AM

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.

java_guy 05-29-2003 01:42 PM

Cool. Thanks!


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.