Subject: bin/10611: /usr/bin/which reads user's .chsrc even if user's shell is not csh
To: None <gnats-bugs@gnats.netbsd.org>
From: None <p99dreyf@criens.u-psud.fr>
List: netbsd-bugs
Date: 07/17/2000 20:11:24
>Number: 10611
>Category: bin
>Synopsis: /usr/bin/which reads user's .chsrc even if user's shell is not csh
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jul 16 14:41:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Emmanuel Dreyfus
>Release: NetBSD-1.4.2
>Organization:
None
>Environment:
NetBSD pimousse 1.4.2 NetBSD 1.4.2 (OLFHEN1) #0: Wed May 31 23:31:41 CEST 2000 root@pimousse:/usr/src/sys/arch/i386/compile/OLFHEN1 i386
>Description:
/usr/bin/which is a csh script. It does read ~/.cshrc. If .cshrc is
buggy, the user will get strange behavior. This is espacially a problem
if the user does not use csh: she will never notice that the problem
comes from .cshrc
>How-To-Repeat:
Be a ksh user. Create a buggy .cshrc (bad commands for instance), try to
run which, you get an error
>Fix:
Change /usr/bin/which first line
#!/bin/csh
to
#!/bin/csh -f
so that it will not read any config file.
>Release-Note:
>Audit-Trail:
>Unformatted: