From owner-freebsd-bugs Tue Oct 6 19:20:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA04498 for freebsd-bugs-outgoing; Tue, 6 Oct 1998 19:20:04 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA04440 for ; Tue, 6 Oct 1998 19:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id TAA29141; Tue, 6 Oct 1998 19:20:00 -0700 (PDT) Received: from mail-relay2.yahoo.com (mr1.yahoo.com [206.251.17.77]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA03397 for ; Tue, 6 Oct 1998 19:17:56 -0700 (PDT) (envelope-from serge@serge.yahoo.com) Received: from borogove.yahoo.com (borogove.yahoo.com [205.216.162.65]) by mail-relay2.yahoo.com (8.9.1a/8.8.8) with ESMTP id TAA03750; Tue, 6 Oct 1998 19:17:44 -0700 (PDT) Received: from serge.yahoo.com (serge.yahoo.com [205.216.162.201]) by borogove.yahoo.com (8.8.7/8.8.8) with ESMTP id TAA17062; Tue, 6 Oct 1998 19:17:37 -0700 (PDT) Received: (from serge@localhost) by serge.yahoo.com (8.8.8/8.8.7) id TAA12930; Tue, 6 Oct 1998 19:17:36 -0700 (PDT) (envelope-from serge) Message-Id: <199810070217.TAA12930@serge.yahoo.com> Date: Tue, 6 Oct 1998 19:17:36 -0700 (PDT) From: serge@yahoo-inc.com Reply-To: serge@yahoo-inc.com To: FreeBSD-gnats-submit@FreeBSD.ORG Cc: serge@yahoo-inc.com X-Send-Pr-Version: 3.2 Subject: kern/8180: open("..",O_RDONLY|O_NONBLOCK) fails Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 8180 >Category: kern >Synopsis: open("..",O_RDONLY|O_NONBLOCK) fails >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 6 19:20:00 PDT 1998 >Last-Modified: >Originator: Sergiy Zhuk >Organization: >Release: FreeBSD 2.2.7-STABLE i386 >Environment: the bug is present in all bsd 2.1.x and 2.2.x (including the latest STABLE) >Description: looks like open() is checking permissions of the mount point rather then permissions of the mounted filesystem. >How-To-Repeat: as root: $ mkdir /sd1 $ chmod 700 /sd1 $ ls -lad /sd1 drwx------ 2 root wheel 512 Oct 2 19:39 /sd1 $ mount /dev/sd1a /sd1 OR $ mount some_host:/exported_fs /sd1 $ ls -ld /sd1 drwxr-xr-x 46 1064 1685 1024 Jan 12 1998 /sd1 as a normal user: $ cd /sd1 $ ls -la .. ls: ..: Permission denied $ cd .. $ ls -la total 2733 drwxr-xr-x 18 root wheel 512 2 ΟΛΤ 19:39 . drwxr-xr-x 18 root wheel 512 2 ΟΛΤ 19:39 .. -rw-r--r-- 2 root wheel 356 21 ΟΛΤ 1997 .cshrc [...] as a result getwd() and getcwd() in /sd1 fails as they do opendir() (which calls open()). >Fix: rewrite kernel code workaround: as root: $ umount /sd1;chmod 755 /sd1 one can use open() + fchdir() instead of getcwd(), but this is not a fix anyway >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message