[22030] in Athena Bugs

home help back first fref pref prev next nref lref last post

sun4 9.1.16: bash

daemon@ATHENA.MIT.EDU (Arun A Tharuvai)
Thu May 8 22:14:42 2003

Message-Id: <200305090214.WAA12884@multics.mit.edu>
To: bugs@MIT.EDU
From: Arun A Tharuvai <aatharuv@MIT.EDU>
Cc: aatharuv@MIT.EDU
Date: Thu, 08 May 2003 22:14:40 -0400

System name:		multics.mit.edu
Type and version:	UltraAX-i2 9.1.16 (with mkserv)
Display type:		unknown

Shell:			/bin/athena/bash
Window manager:		unknown

What were you trying to do?

Summary: Bash users without architecture specific binary directory
under home directory, will have the current directory as the first
element of their PATH.

A user (mforbes) noticed that programs in his current directory, were
being run before other directories in his path, even though . wasn't
the first element. He noticed that in /usr/athena/lib/init/bashrc the line

PATH=`/usr/athena/bin/athdir $HOME`:$athena_path:.

evaluated to :$athena_path:.

Since he didn't have a binary directory for the appropriate platform
`/usr/athena/bin/athdir $HOME` was returning a zero length
string. Bash appears to treat an empty first element as equivalent to
the current directory, putting it at the head of the path.

Below is an untested patch to /usr/athena/lib/init/bashrc that should
fix the problem.

Arun

--- /usr/athena/lib/init/bashrc Sun Jun  9 11:36:58 2002
+++ bashrc2     Thu May  8 22:00:51 2003
@@ -136,7 +136,11 @@
        export COREDUMPSIZE_LIMIT=`ulimit -c`
 
        # Standard Athena path
-       PATH=`/usr/athena/bin/athdir $HOME`:$athena_path:.
+       if [ -z `/usr/athena/bin/athdir $HOME` ]; then 
+               PATH=$athena_path:.  
+       else 
+               PATH=`/usr/athena/bin/athdir $HOME`:$athena_path:.
+       fi
        unset athena_path
 
        # Make sure applications can properly find their appdefs, etc.

home help back first fref pref prev next nref lref last post