From owner-freebsd-bugs Sat Oct 18 00:20:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA02269 for bugs-outgoing; Sat, 18 Oct 1997 00:20:04 -0700 (PDT) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA02260; Sat, 18 Oct 1997 00:20:01 -0700 (PDT) (envelope-from gnats) Resent-Date: Sat, 18 Oct 1997 00:20:01 -0700 (PDT) Resent-Message-Id: <199710180720.AAA02260@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, dan@math.berkeley.edu Received: (from nobody@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA01895; Sat, 18 Oct 1997 00:10:11 -0700 (PDT) (envelope-from nobody) Message-Id: <199710180710.AAA01895@hub.freebsd.org> Date: Sat, 18 Oct 1997 00:10:11 -0700 (PDT) From: dan@math.berkeley.edu To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/4795: glitch in /bin/sh cd command Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4795 >Category: bin >Synopsis: glitch in /bin/sh cd command >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 18 00:20:01 PDT 1997 >Last-Modified: >Originator: Daniel R. Strick >Organization: U.C. Berkeley >Release: 2.2-970930-RELENG >Environment: FreeBSD miwok.berkeley.edu 2.2-970930-RELENG FreeBSD 2.2-970930-RELENG #0: Sun Oct 5 01:29:45 GMT 1997 root@miwok.berkeley.edu:/usr/src/sys/compile/MIWOK i386 >Description: The cd command built into /bin/sh breaks if the shell cannot determine the path leading to the current working directory. This bug can be really nasty because it doesn't teminate the current command, causing shell scripts to run in the wrong directory. Example: miwok% cd /tmp miwok% mkdir -p topdir topdir/middir topdir/middir/botdir miwok% chmod 111 topdir miwok% cd topdir/middir miwok% ls -ls total 1 1 drwxr-xr-x 2 dan bin 512 Oct 17 23:57 botdir miwok% sh sh: cannot determine working directory $ ls -ls total 1 1 drwxr-xr-x 2 dan bin 512 Oct 17 23:57 botdir $ cd botdir; ls -ls cd: can't cd to botdir total 1 1 drwxr-xr-x 2 dan bin 512 Oct 17 23:57 botdir $ >How-To-Repeat: see the example in the "Full Description" >Fix: >Audit-Trail: >Unformatted: