From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 28 09:30:10 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 9070B16A4C1 for ; Thu, 28 Aug 2003 09:30:10 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18F8943FEC for ; Thu, 28 Aug 2003 09:30:07 -0700 (PDT) (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 h7SGU6Up068503 for ; Thu, 28 Aug 2003 09:30:06 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h7SGU6YL068502; Thu, 28 Aug 2003 09:30:06 -0700 (PDT) Resent-Date: Thu, 28 Aug 2003 09:30:06 -0700 (PDT) Resent-Message-Id: <200308281630.h7SGU6YL068502@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, Volker Stolz Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B52A16A4BF for ; Thu, 28 Aug 2003 09:27:31 -0700 (PDT) Received: from atlas.informatik.rwth-aachen.de (atlas.Informatik.RWTH-Aachen.DE [137.226.194.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id A243C43FF2 for ; Thu, 28 Aug 2003 09:27:27 -0700 (PDT) (envelope-from stolz@i2.informatik.rwth-aachen.de) Received: from menelaos.informatik.rwth-aachen.de (menelaos.Informatik.RWTH-Aachen.DE [137.226.194.73]) 8.11.1-0.5) with ESMTP id h7SGRQL04060 for ; Thu, 28 Aug 2003 18:27:26 +0200 Received: (from stolz@localhost)h7SGRQ5s040767; Thu, 28 Aug 2003 18:27:26 +0200 (CEST) (envelope-from stolz) Message-Id: <200308281627.h7SGRQ5s040767@menelaos.informatik.rwth-aachen.de> Date: Thu, 28 Aug 2003 18:27:26 +0200 (CEST) From: Volker Stolz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/56087: [patch] /usr/bin/make segfaults on unreadable "." X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Volker Stolz List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2003 16:30:10 -0000 >Number: 56087 >Category: bin >Synopsis: [patch] /usr/bin/make segfaults on unreadable "." >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 28 09:30:06 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Volker Stolz >Release: FreeBSD 4.8-STABLE i386 >Organization: Lehrstuhl für Informatik II >Environment: System: FreeBSD menelaos.informatik.rwth-aachen.de 4.8-STABLE FreeBSD 4.8-STABLE #8: Fri Aug 22 12:08:19 CEST 2003 root@menelaos.informatik.rwth-aachen.de:/usr/obj/usr/src/sys/MENELAOS i386 >Description: If 'make' is invoked in a restricted directory where it can't read "." it segfaults instead of printing out an error message because of an off-by-one-error. (Happens e.g. when running 'sudo make' on an NFS-mounted, root-squashed directory.) >How-To-Repeat: tmp@menelaos [18:23:37]> mkdir foo tmp@menelaos [18:23:40]> cd foo foo@menelaos [18:23:47]> chmod a= . foo@menelaos [18:23:50]> make Segmentation fault After applying the patch: foo@menelaos [18:24:11]> /usr/obj/usr/src/usr.bin/make/make make: cannot open current directory: Permission denied >Fix: This patch applies to both -CURRENT & -STABLE: --- dir.c.orig Thu Aug 28 18:12:57 2003 +++ dir.c Thu Aug 28 18:13:27 2003 @@ -225,7 +225,7 @@ */ Dir_AddDir (openDirectories, "."); dot = (Path *) Lst_DeQueue (openDirectories); - if (dot == (Path *) NULL) + if (dot == (Path *) NILLNODE) err(1, "cannot open current directory"); /* >Release-Note: >Audit-Trail: >Unformatted: