projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exec: rework the group exit and fix the race with kill
[powerpc.git]
/
fs
/
ext3
/
ioctl.c
diff --git
a/fs/ext3/ioctl.c
b/fs/ext3/ioctl.c
index
9b8090d
..
023a070
100644
(file)
--- a/
fs/ext3/ioctl.c
+++ b/
fs/ext3/ioctl.c
@@
-28,6
+28,7
@@
int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
switch (cmd) {
case EXT3_IOC_GETFLAGS:
switch (cmd) {
case EXT3_IOC_GETFLAGS:
+ ext3_get_inode_flags(ei);
flags = ei->i_flags & EXT3_FL_USER_VISIBLE;
return put_user(flags, (int __user *) arg);
case EXT3_IOC_SETFLAGS: {
flags = ei->i_flags & EXT3_FL_USER_VISIBLE;
return put_user(flags, (int __user *) arg);
case EXT3_IOC_SETFLAGS: {
@@
-40,7
+41,7
@@
int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
if (IS_RDONLY(inode))
return -EROFS;
if (IS_RDONLY(inode))
return -EROFS;
- if (
(current->fsuid != inode->i_uid) && !capable(CAP_FOWNER
))
+ if (
!is_owner_or_cap(inode
))
return -EACCES;
if (get_user(flags, (int __user *) arg))
return -EACCES;
if (get_user(flags, (int __user *) arg))
@@
-50,6
+51,11
@@
int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
flags &= ~EXT3_DIRSYNC_FL;
mutex_lock(&inode->i_mutex);
flags &= ~EXT3_DIRSYNC_FL;
mutex_lock(&inode->i_mutex);
+ /* Is it quota file? Do not allow user to mess with it */
+ if (IS_NOQUOTA(inode)) {
+ mutex_unlock(&inode->i_mutex);
+ return -EPERM;
+ }
oldflags = ei->i_flags;
/* The JOURNAL_DATA flag is modifiable only by root */
oldflags = ei->i_flags;
/* The JOURNAL_DATA flag is modifiable only by root */
@@
-121,7
+127,7
@@
flags_err:
__u32 generation;
int err;
__u32 generation;
int err;
- if (
(current->fsuid != inode->i_uid) && !capable(CAP_FOWNER
))
+ if (
!is_owner_or_cap(inode
))
return -EPERM;
if (IS_RDONLY(inode))
return -EROFS;
return -EPERM;
if (IS_RDONLY(inode))
return -EROFS;
@@
-180,7
+186,7
@@
flags_err:
if (IS_RDONLY(inode))
return -EROFS;
if (IS_RDONLY(inode))
return -EROFS;
- if (
(current->fsuid != inode->i_uid) && !capable(CAP_FOWNER
))
+ if (
!is_owner_or_cap(inode
))
return -EACCES;
if (get_user(rsv_window_size, (int __user *)arg))
return -EACCES;
if (get_user(rsv_window_size, (int __user *)arg))