linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Poetzl <herbert@13thfloor.at>
To: Andrew Morton <akpm@osdl.org>
Cc: torvalds@osdl.org, viro@parcelfarce.linux.theplanet.co.uk,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Bind Mount Extensions 0.04.1 4/5
Date: Mon, 15 Mar 2004 08:58:47 +0100	[thread overview]
Message-ID: <20040315075847.GF31818@MAIL.13thfloor.at> (raw)
In-Reply-To: <20040314203427.27857fd9.akpm@osdl.org>

diff -NurpP --minimal linux-2.6.4-20040314_2308/fs/namei.c linux-2.6.4-20040314_2308-bme0.04.1/fs/namei.c
--- linux-2.6.4-20040314_2308/fs/namei.c	2004-03-11 03:55:25.000000000 +0100
+++ linux-2.6.4-20040314_2308-bme0.04.1/fs/namei.c	2004-03-15 07:29:50.000000000 +0100
@@ -156,15 +156,15 @@ char * getname(const char __user * filen
  * for filesystem access without changing the "normal" uids which
  * are used for other things..
  */
-int vfs_permission(struct inode * inode, int mask)
+int vfs_permission(struct inode * inode, int mask, struct nameidata *nd)
 {
-	umode_t			mode = inode->i_mode;
+	umode_t	mode = inode->i_mode;
 
 	if (mask & MAY_WRITE) {
 		/*
 		 * Nobody gets write access to a read-only fs.
 		 */
-		if (IS_RDONLY(inode) &&
+		if (IS_RDONLY(inode, nd ? nd->mnt : NULL) &&
 		    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
 			return -EROFS;
 
diff -NurpP --minimal linux-2.6.4-20040314_2308/fs/ext2/acl.c linux-2.6.4-20040314_2308-bme0.04.1/fs/ext2/acl.c
--- linux-2.6.4-20040314_2308/fs/ext2/acl.c	2004-03-15 05:41:49.000000000 +0100
+++ linux-2.6.4-20040314_2308-bme0.04.1/fs/ext2/acl.c	2004-03-15 07:44:41.000000000 +0100
@@ -291,7 +292,8 @@ ext2_permission(struct inode *inode, int
 	int mode = inode->i_mode;
 
 	/* Nobody gets write access to a read-only fs */
-	if ((mask & MAY_WRITE) && IS_RDONLY(inode) &&
+	if ((mask & MAY_WRITE) &&
+	    (IS_RDONLY(inode, nd ? nd->mnt : NULL)) &&
 	    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
 		return -EROFS;
 	/* Nobody gets write access to an immutable file */
diff -NurpP --minimal linux-2.6.4-20040314_2308/fs/ext3/acl.c linux-2.6.4-20040314_2308-bme0.04.1/fs/ext3/acl.c
--- linux-2.6.4-20040314_2308/fs/ext3/acl.c	2004-03-15 05:41:49.000000000 +0100
+++ linux-2.6.4-20040314_2308-bme0.04.1/fs/ext3/acl.c	2004-03-15 07:38:42.000000000 +0100
@@ -296,7 +296,8 @@ ext3_permission(struct inode *inode, int
 	int mode = inode->i_mode;
 
 	/* Nobody gets write access to a read-only fs */
-	if ((mask & MAY_WRITE) && IS_RDONLY(inode) &&
+	if ((mask & MAY_WRITE) &&
+	    (IS_RDONLY(inode, nd ? nd->mnt : NULL)) &&
 	    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
 		return -EROFS;
 	/* Nobody gets write access to an immutable file */
diff -NurpP --minimal linux-2.6.4-20040314_2308/fs/jfs/acl.c linux-2.6.4-20040314_2308-bme0.04.1/fs/jfs/acl.c
--- linux-2.6.4-20040314_2308/fs/jfs/acl.c	2004-03-11 03:55:21.000000000 +0100
+++ linux-2.6.4-20040314_2308-bme0.04.1/fs/jfs/acl.c	2004-03-15 07:37:45.000000000 +0100
@@ -136,7 +136,7 @@ int jfs_permission(struct inode * inode,
 		/*
 		 * Nobody gets write access to a read-only fs.
 		 */
-		if (IS_RDONLY(inode) &&
+		if (IS_RDONLY(inode, nd ? nd->mnt : NULL) &&
 		    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
 			return -EROFS;

  parent reply	other threads:[~2004-03-15  7:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15  3:55 [PATCH] Bind Mount Extensions 0.04 (linux-2.6.4) Herbert Poetzl
2004-03-15  4:14 ` Andrew Morton
2004-03-15  4:25   ` Herbert Poetzl
2004-03-15  4:34     ` Andrew Morton
2004-03-15  7:55       ` Herbert Poetzl
2004-03-15  7:56       ` [PATCH] Bind Mount Extensions 0.04.1 1/5 Herbert Poetzl
2004-03-15  7:57       ` [PATCH] Bind Mount Extensions 0.04.1 2/5 Herbert Poetzl
2004-03-18 12:16         ` viro
2004-03-19  1:57           ` Herbert Poetzl
2004-04-02  1:23           ` Herbert Poetzl
2004-03-15  7:58       ` [PATCH] Bind Mount Extensions 0.04.1 3/5 Herbert Poetzl
2004-03-15 22:10         ` Andrew Morton
2004-03-15 23:04           ` Herbert Poetzl
2004-03-15 23:31             ` Andrew Morton
2004-03-16  6:30               ` Herbert Poetzl
2004-03-18 12:26         ` viro
2004-03-19  2:52           ` Herbert Poetzl
2004-03-19 11:11             ` viro
2004-03-19 13:40               ` Herbert Poetzl
2004-03-19 14:52                 ` viro
2004-03-15  7:58       ` Herbert Poetzl [this message]
2004-03-15  7:59       ` [PATCH] Bind Mount Extensions 0.04.1 5/5 Herbert Poetzl
2004-03-15 13:25   ` [PATCH] Bind Mount Extensions 0.04 (linux-2.6.4) Marc-Christian Petersen
2004-03-15 18:25     ` Dariush Pietrzak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040315075847.GF31818@MAIL.13thfloor.at \
    --to=herbert@13thfloor.at \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).