Commit 14183fd4 authored by Theodore Y. Ts'o's avatar Theodore Y. Ts'o Committed by Linus Torvalds

Port of 0.8.50 acl-ms-posixacl patch to 2.5

This patch (as well as the previous one) implements core ACL support
which is needed for XFS as well as ext2/3 ACL support.  It causes umask
handling to be skilled for inodes that contain POSIX acl's, so that the
original mode information can be passed down to the low-level fs code,
which will take care of handling the umask.
parent 762b1b86
...@@ -1279,8 +1279,9 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) ...@@ -1279,8 +1279,9 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
/* Negative dentry, just create the file */ /* Negative dentry, just create the file */
if (!dentry->d_inode) { if (!dentry->d_inode) {
error = vfs_create(dir->d_inode, dentry, if (!IS_POSIXACL(dir->d_inode))
mode & ~current->fs->umask); mode &= ~current->fs->umask;
error = vfs_create(dir->d_inode, dentry, mode);
up(&dir->d_inode->i_sem); up(&dir->d_inode->i_sem);
dput(nd->dentry); dput(nd->dentry);
nd->dentry = dentry; nd->dentry = dentry;
...@@ -1442,6 +1443,7 @@ asmlinkage long sys_mknod(const char * filename, int mode, dev_t dev) ...@@ -1442,6 +1443,7 @@ asmlinkage long sys_mknod(const char * filename, int mode, dev_t dev)
dentry = lookup_create(&nd, 0); dentry = lookup_create(&nd, 0);
error = PTR_ERR(dentry); error = PTR_ERR(dentry);
if (!IS_POSIXACL(nd.dentry->d_inode))
mode &= ~current->fs->umask; mode &= ~current->fs->umask;
if (!IS_ERR(dentry)) { if (!IS_ERR(dentry)) {
switch (mode & S_IFMT) { switch (mode & S_IFMT) {
...@@ -1508,8 +1510,9 @@ asmlinkage long sys_mkdir(const char * pathname, int mode) ...@@ -1508,8 +1510,9 @@ asmlinkage long sys_mkdir(const char * pathname, int mode)
dentry = lookup_create(&nd, 1); dentry = lookup_create(&nd, 1);
error = PTR_ERR(dentry); error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) { if (!IS_ERR(dentry)) {
error = vfs_mkdir(nd.dentry->d_inode, dentry, if (!IS_POSIXACL(nd.dentry->d_inode))
mode & ~current->fs->umask); mode &= ~current->fs->umask;
error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);
dput(dentry); dput(dentry);
} }
up(&nd.dentry->d_inode->i_sem); up(&nd.dentry->d_inode->i_sem);
......
...@@ -110,6 +110,7 @@ extern int leases_enable, dir_notify_enable, lease_break_time; ...@@ -110,6 +110,7 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
#define MS_MOVE 8192 #define MS_MOVE 8192
#define MS_REC 16384 #define MS_REC 16384
#define MS_VERBOSE 32768 #define MS_VERBOSE 32768
#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
#define MS_ACTIVE (1<<30) #define MS_ACTIVE (1<<30)
#define MS_NOUSER (1<<31) #define MS_NOUSER (1<<31)
...@@ -164,6 +165,7 @@ extern int leases_enable, dir_notify_enable, lease_break_time; ...@@ -164,6 +165,7 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) #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_NOATIME(inode) (__IS_FLG(inode, MS_NOATIME) || ((inode)->i_flags & S_NOATIME))
#define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME) #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) #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment