Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jun 1999 08:10:55 -0700 (PDT)
From:      jose@we.lc.ehu.es
To:        freebsd-gnats-submit@freebsd.org
Subject:   bin/12244: realpath() fails when there is no permission to read the WD
Message-ID:  <19990616151055.F3FB61501A@hub.freebsd.org>

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

>Number:         12244
>Category:       bin
>Synopsis:       realpath() fails when there is no permission to read the WD
>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:   Wed Jun 16 08:20:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Jose M. Alcaide
>Release:        3.2-RELEASE
>Organization:
Universidad del Pais Vasco - Dept. de Electricidad y Electronica
>Environment:
FreeBSD garatu.we.lc.ehu.es 3.2-RELEASE FreeBSD 3.2-RELEASE #0: Tue May 18 18:40:58 CEST 1999     root@garatu.we.lc.ehu.es:/usr/src/sys/compile/GARATU  i386

>Description:
The realpath() function fails when the WD cannot be opened for reading.
One of the utilities affected by this problem is mount(8): it fails
when the working directory is NFS-mounted, it is being exported
without root access, and there is no permission to read it.

The origin of this problem is that realpath() uses the open()/fchdir()
method for saving/restoring the working directory. Unfortunately, this
method fails when the WD cannot be opened. In this case, the more
traditional (although less efficient) getwd()/chdir() method does
work.
>How-To-Repeat:
Obvious.
>Fix:
Change the method realpath() uses for saving/restoring the working
directory (getwd()/chdir() instead of open()/fchdir()).


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990616151055.F3FB61501A>