From owner-cvs-all@FreeBSD.ORG Tue Jun 8 06:23:23 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A27EB16A4CE; Tue, 8 Jun 2004 06:23:23 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AFD043D46; Tue, 8 Jun 2004 06:23:23 +0000 (GMT) (envelope-from das@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i586NN00064832; Tue, 8 Jun 2004 06:23:23 GMT (envelope-from das@repoman.freebsd.org) Received: (from das@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i586NNU9064831; Tue, 8 Jun 2004 06:23:23 GMT (envelope-from das) Message-Id: <200406080623.i586NNU9064831@repoman.freebsd.org> From: David Schultz Date: Tue, 8 Jun 2004 06:23:23 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libc/gen fts.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2004 06:23:23 -0000 das 2004-06-08 06:23:23 UTC FreeBSD src repository Modified files: lib/libc/gen fts.c Log: In fts_build(), if we try to chdir and fail (e.g. due to lack of search permission), try to continue in FTS_DONTCHDIR mode. Of course this won't work for long paths, but we can't descend more than one pathname component beyond the directory anyway if we lack search permission. Here is a transcript demonstrating the change, where oldls is ls(1) linked with the old fts(3): das@VARK:~> mkdir t && touch t/{a,b,c} && chmod u-x t das@VARK:~> oldls t a b c das@VARK:~> oldls -l t das@VARK:~> \ls t a b c das@VARK:~> \ls -l t ls: a: Permission denied ls: b: Permission denied ls: c: Permission denied I had forgotten about this patch until bde reminded me. He reports using it without problems for over a year. PR: 45723 Revision Changes Path 1.27 +0 -2 src/lib/libc/gen/fts.c