Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 2004 21:35:56 +0300
From:      Arkadi Shishlov <arkadi@hosting.lv>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/67943: find(1) fails when current directory is not readable by user
Message-ID:  <E1BZwJI-0004fy-00@idea.hosting.lv>
Resent-Message-ID: <200406141840.i5EIeMeq027668@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         67943
>Category:       bin
>Synopsis:       find(1) fails when current directory is not readable by user
>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:   Mon Jun 14 18:40:22 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Arkadi Shishlov
>Release:        FreeBSD 4.9-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD idea.hosting.lv 4.9-RELEASE-p3 FreeBSD 4.9-RELEASE-p3 #0: Wed Mar 3 21:51:26 EET 2004 root@idea.hosting.lv:/usr/obj/usr/src/sys/idea i386

>Description:
find(1) utility opens current directory dotfd = open(".", O_RDONLY, 0)
and use obtained dotfd handle later in fchdir(). 
If current directory is not readable by user then find fails.

>How-To-Repeat:
mkdir dir
chmod -r dir
cd dir
find /tmp
find: .: Permission denied

>Fix:
dotfd handle is only used when -exec predicate is requested.
find(1) from GNU findutils combat this situation by using getcwd()
call in case cwd is not readable.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1BZwJI-0004fy-00>