Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-17 Thread Satyam Sharma
[ Ok, last overview of this thing. ] On Tue, 17 Jul 2007, Satyam Sharma wrote: > On Mon, 16 Jul 2007, Al Viro wrote: > > On Tue, Jul 17, 2007 at 01:00:42AM +0530, Satyam Sharma wrote: > > > > if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) > > > > > > > > test is a rather

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-17 Thread Satyam Sharma
[ Ok, last overview of this thing. ] On Tue, 17 Jul 2007, Satyam Sharma wrote: On Mon, 16 Jul 2007, Al Viro wrote: On Tue, Jul 17, 2007 at 01:00:42AM +0530, Satyam Sharma wrote: if ((current-fsuid != inode-i_uid) !capable(CAP_FOWNER)) test is a rather common test, and in

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Tue, 17 Jul 2007, Al Viro wrote: > On Tue, Jul 17, 2007 at 03:24:14AM +0530, Satyam Sharma wrote: > > On Tue, 17 Jul 2007, Satyam Sharma wrote: > > > [...] > > > Anwyay, so I'm thinking of adding: > > > > > > struct inode; > > > > > > int is_not_owner(struct inode *) > > > > ^static inline

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Al Viro
On Tue, Jul 17, 2007 at 03:24:14AM +0530, Satyam Sharma wrote: > On Tue, 17 Jul 2007, Satyam Sharma wrote: > > [...] > > Anwyay, so I'm thinking of adding: > > > > struct inode; > > > > int is_not_owner(struct inode *) > > ^static inline ^inode > > of course. > > { > >

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Tue, 17 Jul 2007, Satyam Sharma wrote: > [...] > Anwyay, so I'm thinking of adding: > > struct inode; > > int is_not_owner(struct inode *) ^static inline ^inode of course. > { > return ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)); > } > > to

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Mon, 16 Jul 2007, Al Viro wrote: > On Tue, Jul 17, 2007 at 01:00:42AM +0530, Satyam Sharma wrote: > > > if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) > > > > > > test is a rather common test, and in fact, arguably, every time you see > > > one part of it, you should probably

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Al Viro
On Tue, Jul 17, 2007 at 01:00:42AM +0530, Satyam Sharma wrote: > > if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) > > > > test is a rather common test, and in fact, arguably, every time you see > > one part of it, you should probably see the other. Would it make sense to > >

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Mon, 16 Jul 2007, Linus Torvalds wrote: > > > On Tue, 17 Jul 2007, Satyam Sharma wrote: > > > > [PATCH] utime(s): Honour CAP_FOWNER when times==NULL > > > > do_utimes() does not honour CAP_FOWNER when times==NULL. > > Trivial and obvious

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Linus Torvalds
On Tue, 17 Jul 2007, Satyam Sharma wrote: > > [PATCH] utime(s): Honour CAP_FOWNER when times==NULL > > do_utimes() does not honour CAP_FOWNER when times==NULL. > Trivial and obvious one-line fix. Ahh, ok. Is this old, or was it introduced recently (I'm looking at my recent chan

[PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
[PATCH] utime(s): Honour CAP_FOWNER when times==NULL do_utimes() does not honour CAP_FOWNER when times==NULL. Trivial and obvious one-line fix. Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]> --- BTW this bug was hidden by the fact that we call vfs_permission() from the code

[PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
[PATCH] utime(s): Honour CAP_FOWNER when times==NULL do_utimes() does not honour CAP_FOWNER when times==NULL. Trivial and obvious one-line fix. Signed-off-by: Satyam Sharma [EMAIL PROTECTED] --- BTW this bug was hidden by the fact that we call vfs_permission() from the code below

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Linus Torvalds
On Tue, 17 Jul 2007, Satyam Sharma wrote: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL do_utimes() does not honour CAP_FOWNER when times==NULL. Trivial and obvious one-line fix. Ahh, ok. Is this old, or was it introduced recently (I'm looking at my recent change to that area

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Mon, 16 Jul 2007, Linus Torvalds wrote: On Tue, 17 Jul 2007, Satyam Sharma wrote: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL do_utimes() does not honour CAP_FOWNER when times==NULL. Trivial and obvious one-line fix. Ahh, ok. Is this old, or was it introduced

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Al Viro
On Tue, Jul 17, 2007 at 01:00:42AM +0530, Satyam Sharma wrote: if ((current-fsuid != inode-i_uid) !capable(CAP_FOWNER)) test is a rather common test, and in fact, arguably, every time you see one part of it, you should probably see the other. Would it make sense to make a helper

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Mon, 16 Jul 2007, Al Viro wrote: On Tue, Jul 17, 2007 at 01:00:42AM +0530, Satyam Sharma wrote: if ((current-fsuid != inode-i_uid) !capable(CAP_FOWNER)) test is a rather common test, and in fact, arguably, every time you see one part of it, you should probably see the other.

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Tue, 17 Jul 2007, Satyam Sharma wrote: [...] Anwyay, so I'm thinking of adding: struct inode; int is_not_owner(struct inode *) ^static inline ^inode of course. { return ((current-fsuid != inode-i_uid) !capable(CAP_FOWNER)); } to linux/capability.h

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Al Viro
On Tue, Jul 17, 2007 at 03:24:14AM +0530, Satyam Sharma wrote: On Tue, 17 Jul 2007, Satyam Sharma wrote: [...] Anwyay, so I'm thinking of adding: struct inode; int is_not_owner(struct inode *) ^static inline ^inode of course. { return

Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

2007-07-16 Thread Satyam Sharma
On Tue, 17 Jul 2007, Al Viro wrote: On Tue, Jul 17, 2007 at 03:24:14AM +0530, Satyam Sharma wrote: On Tue, 17 Jul 2007, Satyam Sharma wrote: [...] Anwyay, so I'm thinking of adding: struct inode; int is_not_owner(struct inode *) ^static inline ^inode