[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[FIX] Re: symlink permissions



Hello Keith and Andrew,

On Tue, 2004-12-07 at 09:19, Keith Young wrote:
> When CONFIG_EXT3_FS_POSIX_ACL is not defined, ext3_init_acl() is an
> inline function in fs/ext3/acl.h which doesn't check if a file is a
> symlink before applying umask.

That's a bug, indeed. Thanks for reporting; a fix is attached.

Andrew, could you please push this to Linus? Thanks!

Cheers,
-- 
Andreas Gruenbacher <agruen suse de>
SUSE Labs, SUSE LINUX GMBH
--- Begin Message ---
Keith Young <stripyd stripydog com> has reported that when ACLs are
not compiled in, the default implementation of ext[23]_init_acl applies
the umask to all new files, including symlinks, which is wrong. In this
case the VFS already takes care of applying the umask when needed, so
ext2 and ext3 need not bother about it. Remove the superfluous
statements.

Signed-off-by: Andreas Gruenbacher <agruen suse de>

Index: linux-2.6.10-rc2/fs/ext3/acl.h
===================================================================
--- linux-2.6.10-rc2.orig/fs/ext3/acl.h
+++ linux-2.6.10-rc2/fs/ext3/acl.h
@@ -79,7 +79,6 @@ ext3_acl_chmod(struct inode *inode)
 static inline int
 ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
 {
-	inode->i_mode &= ~current->fs->umask;
 	return 0;
 }
 #endif  /* CONFIG_EXT3_FS_POSIX_ACL */
Index: linux-2.6.10-rc2/fs/ext2/acl.h
===================================================================
--- linux-2.6.10-rc2.orig/fs/ext2/acl.h
+++ linux-2.6.10-rc2/fs/ext2/acl.h
@@ -77,7 +77,6 @@ ext2_acl_chmod (struct inode *inode)
 
 static inline int ext2_init_acl (struct inode *inode, struct inode *dir)
 {
-	inode->i_mode &= ~current->fs->umask;
 	return 0;
 }
 #endif

--- End Message ---

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]