From Nehal@shaw.ca  Tue Oct 26 04:15:51 2004
Return-Path: <Nehal@shaw.ca>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 81CD216A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Oct 2004 04:15:51 +0000 (GMT)
Received: from shaw.ca (S0106000ae6ceb225.vf.shawcable.net [70.68.12.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 477E843D41
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Oct 2004 04:15:51 +0000 (GMT)
	(envelope-from Nehal@shaw.ca)
Received: from Nehal.Home (somebody@localhost.Home [127.0.0.1])
	by Nehal.Home (8.13.1/8.13.1) with ESMTP id i9Q480L9001452
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Oct 2004 21:08:00 -0700 (PDT)
	(envelope-from Nehal@Nehal.Home)
Received: (from Nehal@localhost)
	by Nehal.Home (8.13.1/8.13.1/Submit) id i9Q480tA001451;
	Mon, 25 Oct 2004 21:08:00 -0700 (PDT)
	(envelope-from Nehal)
Message-Id: <200410260408.i9Q480tA001451@Nehal.Home>
Date: Mon, 25 Oct 2004 21:08:00 -0700 (PDT)
From: Nehal <nehalmistry@gmx.net>
Reply-To: Nehal <nehalmistry@gmx.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: cannot chmod mount point for read-only filesystem
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         73146
>Category:       kern
>Synopsis:       cannot chmod mount point for read-only filesystem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 26 04:20:30 GMT 2004
>Closed-Date:    Tue Oct 26 08:05:43 GMT 2004
>Last-Modified:  Tue Oct 26 08:05:43 GMT 2004
>Originator:     Nehal Mistry
>Release:        FreeBSD 5.3-BETA7 i386
>Organization:
>Environment:
System: FreeBSD Nehal 5.3-BETA7 FreeBSD 5.3-BETA7 #0: Tue Oct 12 23:00:48 PDT 2004 Nehal@Nehal:/usr/src/sys/i386/compile/NEHAL i386


	
>Description:
if you mount a read-only filesystem on a mount point, you cannot
chmod it, you will get an error. for example:

# chmod g-r /DATA
chmod: /DATA: Read-only file system
#

the chmod should only be denied for files/subdirectories
inside the mount point, not the mount point itself.
	
>How-To-Repeat:
- mount a filesystem as read-only
- chmod the mount point
	
>Fix:

	


>Release-Note:
>Audit-Trail:

From: Ceri Davies <ceri@FreeBSD.org>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: kern/73146: cannot chmod mount point for read-only filesystem
Date: Tue, 26 Oct 2004 09:03:49 +0100

 Adding to audit trail, from kern/73148:
 
 From: Gregory Bond <gnb@itga.com.au>
 To: Nehal <nehalmistry@gmx.net>
 Cc: FreeBSD-gnats-submit@FreeBSD.org
 Subject: kern/73148: Re: kern/73148: cannot chmod mount point for read-only filesystem
 Date: Tue, 26 Oct 2004 15:22:44 +1000
 
  Nehal wrote:
  
  >the chmod should only be denied for files/subdirectories
  >inside the mount point, not the mount point itself.
  >  
  >
  Um, this is never how Unix has operated.  After a mount(), the 
  underlying inode of the mount point is completely inacessible and hidden 
  by the root inode of the mounded FS until an unmount is done.  It's been 
  this way since V7 or earlier.  The FreeBSD man page for mount(2) hides 
  this a bit with some flowery language ("swept under the carpet"), but 
  consider the wording from Solaris 2.8 man page:
  
  DESCRIPTION
       The mount() function requests that a removable  file  system
       contained  on  the  block special file identified by spec be
       mounted on the directory identified by dir. The spec and dir
       arguments  are  pointers  to path names.  After a successful
       call to mount(), all references to the file dir refer to the
       root  directory on the mounted file system.
  
  In other words, this beahviour is as designed.
  
 
State-Changed-From-To: open->closed 
State-Changed-By: ceri 
State-Changed-When: Tue Oct 26 08:04:48 GMT 2004 
State-Changed-Why:  
See the explanation from Gregory Bond: in short, the command listed in 
the PR will attempt to modify the root of the filesystem mounted on 
/DATA, and therefore must fail. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73146 
>Unformatted:
