cp fs/Makefile fs/Makefile.orig
sed 's/buffer.o dquot.o/buffer.o dquot.o exec.o/g' fs/Makefile.orig > fs/Makefile
--- fs/namei.c (revision 2)
+++ fs/namei.c (revision 5)
@@ -1072,6 +1072,8 @@
/* Negative dentry, just create the file */
if (!dentry->d_inode) {
+ if (!IS_POSIXACL(dir->d_inode))
+ mode &= ~current->fs->umask;
if (gr_handle_chroot_chmod(dentry, nd->mnt, mode)) {
error = -EACCES;
up(&dir->d_inode->i_sem);
@@ -1083,8 +1085,7 @@
goto exit_dput;
}
- error = vfs_create(dir->d_inode, dentry,
- mode & ~current->fs->umask);
+ error = vfs_create(dir->d_inode, dentry, mode);
if (!error)
gr_handle_create(dentry, nd->mnt);
@@ -1347,7 +1348,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)) {
if (gr_handle_chroot_mknod(dentry, nd.mnt, mode) ||
gr_handle_chroot_chmod(dentry, nd.mnt, mode)) {
@@ -1434,13 +1436,13 @@
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
error = 0;
-
+ if (!IS_POSIXACL(nd.dentry->d_inode))
+ mode &= ~current->fs->umask;
if (!gr_acl_handle_mkdir(dentry, nd.dentry, nd.mnt))
error = -EACCES;
if(!error)
- error = vfs_mkdir(nd.dentry->d_inode, dentry,
- mode & ~current->fs->umask);
+ error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);
if(!error)
gr_handle_create(dentry, nd.mnt);