From owner-freebsd-bugs Wed Jun 16 8:20: 3 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 0493D14DEF for ; Wed, 16 Jun 1999 08:20:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id IAA32191; Wed, 16 Jun 1999 08:20:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id F3FB61501A; Wed, 16 Jun 1999 08:10:55 -0700 (PDT) Message-Id: <19990616151055.F3FB61501A@hub.freebsd.org> Date: Wed, 16 Jun 1999 08:10:55 -0700 (PDT) From: jose@we.lc.ehu.es To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: bin/12244: realpath() fails when there is no permission to read the WD Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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