Bug 101019 - Scripts named "test" when "." is in $path before /usr/bin recursively call themselves
Scripts named "test" when "." is in $path before /usr/bin recursively call th...
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: tcsh (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-07-28 12:36 EDT by Arthur Person
Modified: 2007-04-18 12:56 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-19 14:14:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Arthur Person 2003-07-28 12:36:38 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:
tcsh scripts named "test" will recursively call themselves when dot (".") is in 
$path before /usr/bin.  Example:

set path=(. $path)

then run in tcsh:

#!/bin/csh
echo .
echo $path

Be ready to pkill "test" or you will jam your system.


Version-Release number of selected component (if applicable):
With RedHat 9

How reproducible:
Always

Steps to Reproduce:
1.Run example code in Description
2.
3.
    

Actual Results:  The script recursively calls itself and jams the system.

Expected Results:  The script should have returned "." and the value of $path.

Additional info:

It would appear the tcsh is using the system "test" command when doing "echo" 
but uses the user defined $path to find it.
Comment 1 Miloslav Trmač 2004-08-19 14:14:46 EDT
No, (test) is used in /etc/profile.d/colorls.csh, which
is sourced from /etc/csh.cshrc.

If you modify $path so that standard POSIX commands don't work,
you can't expect to have a sane environment. Many programs
would likewise fail if you have a custom script called "ls".

Note You need to log in before you can comment on or make changes to this bug.