File: [Development] / linux-2.4-xfs / split-patches / acl-backport (download)
Revision 1.4, Thu Jan 20 13:59:19 2005 UTC (12 years, 8 months ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.3: +20 -11
lines
Merge up to 2.4.29.
Merge of 2.4.x-xfs-melb:linux:21231a by kenmcd.
|
%patch
Index: 2.4.x-xfs/Documentation/Configure.help
===================================================================
--- 2.4.x-xfs.orig/Documentation/Configure.help 2005-01-20 16:23:40.000000000 +1100
+++ 2.4.x-xfs/Documentation/Configure.help 2005-01-20 16:24:07.000000000 +1100
@@ -17618,6 +17618,16 @@
If unsure, say N.
+POSIX ACL support
+CONFIG_XFS_POSIX_ACL
+ POSIX Access Control Lists (ACLs) support permissions for users and
+ groups beyond the owner/group/world scheme.
+
+ To learn more about Access Control Lists, visit the POSIX ACLs for
+ Linux website <http://acl.bestbits.at/>.
+
+ If you don't know what Access Control Lists are, say N.
+
Tracing support (EXPERIMENTAL)
CONFIG_XFS_TRACE
Say Y here to get an XFS build with activity tracing enabled.
Index: 2.4.x-xfs/fs/Config.in
===================================================================
--- 2.4.x-xfs.orig/fs/Config.in 2004-11-22 12:29:08.000000000 +1100
+++ 2.4.x-xfs/fs/Config.in 2005-01-20 16:24:07.000000000 +1100
@@ -102,6 +102,7 @@
dep_mbool ' UFS file system write support (DANGEROUS)' CONFIG_UFS_FS_WRITE $CONFIG_UFS_FS $CONFIG_EXPERIMENTAL
tristate 'XFS filesystem support' CONFIG_XFS_FS
+dep_mbool ' POSIX ACL support' CONFIG_XFS_POSIX_ACL $CONFIG_XFS_FS
dep_mbool ' Quota support' CONFIG_XFS_QUOTA $CONFIG_XFS_FS
dep_mbool ' Realtime support (EXPERIMENTAL)' CONFIG_XFS_RT $CONFIG_XFS_FS $CONFIG_EXPERIMENTAL
dep_mbool ' Tracing support (EXPERIMENTAL)' CONFIG_XFS_TRACE $CONFIG_XFS_FS $CONFIG_EXPERIMENTAL
Index: 2.4.x-xfs/fs/namei.c
===================================================================
--- 2.4.x-xfs.orig/fs/namei.c 2005-01-20 16:15:42.000000000 +1100
+++ 2.4.x-xfs/fs/namei.c 2005-01-20 16:24:07.000000000 +1100
@@ -1048,8 +1048,9 @@
/* Negative dentry, just create the file */
if (!dentry->d_inode) {
- error = vfs_create(dir->d_inode, dentry,
- mode & ~current->fs->umask);
+ if (!IS_POSIXACL(dir->d_inode))
+ mode &= ~current->fs->umask;
+ error = vfs_create(dir->d_inode, dentry, mode);
up(&dir->d_inode->i_sem);
dput(nd->dentry);
nd->dentry = dentry;
@@ -1280,7 +1281,8 @@
dentry = lookup_create(&nd, 0);
error = PTR_ERR(dentry);
- mode &= ~current->fs->umask;
+ if (!IS_POSIXACL(nd.dentry->d_inode))
+ mode &= ~current->fs->umask;
if (!IS_ERR(dentry)) {
switch (mode & S_IFMT) {
case 0: case S_IFREG:
@@ -1348,8 +1350,9 @@
dentry = lookup_create(&nd, 1);
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
- error = vfs_mkdir(nd.dentry->d_inode, dentry,
- mode & ~current->fs->umask);
+ if (!IS_POSIXACL(nd.dentry->d_inode))
+ mode &= ~current->fs->umask;
+ error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
Index: 2.4.x-xfs/include/linux/fs.h
===================================================================
--- 2.4.x-xfs.orig/include/linux/fs.h 2004-11-22 12:29:08.000000000 +1100
+++ 2.4.x-xfs/include/linux/fs.h 2005-01-20 16:24:07.000000000 +1100
@@ -111,6 +111,7 @@
#define MS_MOVE 8192
#define MS_REC 16384
#define MS_VERBOSE 32768
+#define MS_POSIXACL 65536 /* VFS does not apply the umask */
#define MS_ACTIVE (1<<30)
#define MS_NOUSER (1<<31)
@@ -161,6 +162,7 @@
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
#define IS_NOATIME(inode) (__IS_FLG(inode, MS_NOATIME) || ((inode)->i_flags & S_NOATIME))
#define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME)
+#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
Index: 2.4.x-xfs/include/linux/posix_acl_xattr.h
===================================================================
--- 2.4.x-xfs.orig/include/linux/posix_acl_xattr.h 1970-01-01 10:00:00.000000000 +1000
+++ 2.4.x-xfs/include/linux/posix_acl_xattr.h 2005-01-20 16:24:07.000000000 +1100
@@ -0,0 +1,67 @@
+/*
+ File: linux/posix_acl_xattr.h
+
+ Extended attribute system call representation of Access Control Lists.
+
+ Copyright (C) 2000 by Andreas Gruenbacher <a.gruenbacher@computer.org>
+ Copyright (C) 2002 SGI - Silicon Graphics, Inc <linux-xfs@oss.sgi.com>
+ */
+#ifndef _POSIX_ACL_XATTR_H
+#define _POSIX_ACL_XATTR_H
+
+/* Extended attribute names */
+#define POSIX_ACL_XATTR_ACCESS "system.posix_acl_access"
+#define POSIX_ACL_XATTR_DEFAULT "system.posix_acl_default"
+
+/* Supported ACL a_version fields */
+#define POSIX_ACL_XATTR_VERSION 0x0002
+
+
+/* An undefined entry e_id value */
+#define ACL_UNDEFINED_ID (-1)
+
+/* ACL entry e_tag field values */
+#define ACL_USER_OBJ (0x01)
+#define ACL_USER (0x02)
+#define ACL_GROUP_OBJ (0x04)
+#define ACL_GROUP (0x08)
+#define ACL_MASK (0x10)
+#define ACL_OTHER (0x20)
+
+/* ACL entry e_perm bitfield values */
+#define ACL_READ (0x04)
+#define ACL_WRITE (0x02)
+#define ACL_EXECUTE (0x01)
+
+
+typedef struct {
+ __u16 e_tag;
+ __u16 e_perm;
+ __u32 e_id;
+} posix_acl_xattr_entry;
+
+typedef struct {
+ __u32 a_version;
+ posix_acl_xattr_entry a_entries[0];
+} posix_acl_xattr_header;
+
+
+static inline size_t
+posix_acl_xattr_size(int count)
+{
+ return (sizeof(posix_acl_xattr_header) +
+ (count * sizeof(posix_acl_xattr_entry)));
+}
+
+static inline int
+posix_acl_xattr_count(size_t size)
+{
+ if (size < sizeof(posix_acl_xattr_header))
+ return -1;
+ size -= sizeof(posix_acl_xattr_header);
+ if (size % sizeof(posix_acl_xattr_entry))
+ return -1;
+ return size / sizeof(posix_acl_xattr_entry);
+}
+
+#endif /* _POSIX_ACL_XATTR_H */
%diffstat
Documentation/Configure.help | 10 +++++
fs/Config.in | 1
fs/namei.c | 13 ++++---
include/linux/fs.h | 2 +
include/linux/posix_acl_xattr.h | 67 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 88 insertions(+), 5 deletions(-)