Bug 101019 - Scripts named "test" when "." is in $path before /usr/bin recursively call themselves
Summary: Scripts named "test" when "." is in $path before /usr/bin recursively call th...
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tcsh   
(Show other bugs)
Version: 9
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-07-28 16:36 UTC by Arthur Person
Modified: 2007-04-18 16:56 UTC (History)
0 users

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

Attachments (Terms of Use)

Description Arthur Person 2003-07-28 16:36:38 UTC
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:

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:

Steps to Reproduce:
1.Run example code in Description

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 18:14:46 UTC
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.