Date: Thu, 28 Aug 2003 18:27:26 +0200 (CEST) From: Volker Stolz <stolz@i2.informatik.rwth-aachen.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/56087: [patch] /usr/bin/make segfaults on unreadable "." Message-ID: <200308281627.h7SGRQ5s040767@menelaos.informatik.rwth-aachen.de> Resent-Message-ID: <200308281630.h7SGU6YL068502@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308281627.h7SGRQ5s040767>