From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 20 14:30:23 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90FF616A4CE for ; Thu, 20 Nov 2003 14:30:23 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C12443FD7 for ; Thu, 20 Nov 2003 14:30:22 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hAKMULFY016606 for ; Thu, 20 Nov 2003 14:30:21 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hAKMULpc016605; Thu, 20 Nov 2003 14:30:21 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 20 Nov 2003 14:30:21 -0800 (PST) Resent-Message-Id: <200311202230.hAKMULpc016605@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Afanasiev Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AFAC16A4CE for ; Thu, 20 Nov 2003 14:28:06 -0800 (PST) Received: from orion.ifmo.ru (kot.spb.ru [194.85.164.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id F22574401E for ; Thu, 20 Nov 2003 14:28:04 -0800 (PST) (envelope-from dima@KOT.SPb.Ru) Received: from orion.ifmo.ru (dima@localhost [127.0.0.1]) by orion.ifmo.ru (8.12.9p2/8.12.9) with ESMTP id hAKMS3Ti086238 for ; Fri, 21 Nov 2003 01:28:03 +0300 (MSK) (envelope-from dima@orion.ifmo.ru) Received: (from dima@localhost) by orion.ifmo.ru (8.12.9p2/8.12.9/Submit) id hAKMS3JB086237; Fri, 21 Nov 2003 01:28:03 +0300 (MSK) (envelope-from dima) Message-Id: <200311202228.hAKMS3JB086237@orion.ifmo.ru> Date: Fri, 21 Nov 2003 01:28:03 +0300 (MSK) From: Dmitry Afanasiev To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/59530: strange bug in /bin/sh X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dmitry Afanasiev List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2003 22:30:23 -0000 >Number: 59530 >Category: bin >Synopsis: strange bug in /bin/sh >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 20 14:30:20 PST 2003 >Closed-Date: >Last-Modified: >Originator: Dmitry Afanasiev >Release: FreeBSD 4.9-RC i386 >Organization: >Environment: System: FreeBSD orion 4.9-RC FreeBSD 4.9-RC #31: Mon Oct 6 16:12:22 MSD 2003 root@orion:/usr/obj/usr/src/sys/MATPOCKuH i386 >Description: If cd builted in /bin/sh called to directory with no permissions, current directory after this is is not valid. >How-To-Repeat: (!) Not from root: $ mkdir test $ cd test $ mkdir noperm $ chmod 0 noperm $ cd noperm cd: can't cd to noperm $ pwd /tmp/test/noperm $ cd noperm cd: can't cd to noperm $ cd noperm cd: can't cd to noperm $ pwd /tmp/test/noperm/noperm/noperm $ ls noperm >Fix: --- cd.c.orig Fri Nov 21 01:10:44 2003 +++ cd.c Fri Nov 21 01:10:02 2003 @@ -204,7 +204,7 @@ } INTOFF; - if (updatepwd(badstat ? NULL : dest) < 0 || chdir(curdir) < 0) { + if (chdir(curdir) < 0 || updatepwd(badstat ? NULL : dest) < 0) { INTON; return (-1); } But this path may be incorrect. :) >Release-Note: >Audit-Trail: >Unformatted: