mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Satyam Sharma <ssatyam@cse.iitk.ac.in>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Al Viro <viro@ftp.linux.org.uk>,
	Ulrich Drepper <drepper@redhat.com>
Subject: Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL
Date: Mon, 16 Jul 2007 11:47:26 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707161142210.20061@woody.linux-foundation.org> (raw)
In-Reply-To: <20070716185423.1607.78787.sendpatchset@cselinux1.cse.iitk.ac.in>



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, it doesn't seem to introduce this)?

IOW, how did you even notice this?

Also, while your one-liner looks correct, it does make me wonder: the 
whole

	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 inline function to do this, and replace all users? Doing a

	git grep 'fsuid.*\<i_uid\>'

seems to show quite a few cases of this pattern..

		Linus

  reply	other threads:[~2007-07-16 18:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070716185423.1607.78787.sendpatchset@cselinux1.cse.iitk.ac.i n>
2007-07-16 18:54 ` Satyam Sharma
2007-07-16 18:47   ` Linus Torvalds [this message]
2007-07-16 19:30     ` Satyam Sharma
2007-07-16 20:45       ` Al Viro
2007-07-16 21:46         ` Satyam Sharma
2007-07-16 21:54           ` Satyam Sharma
2007-07-16 23:18             ` Al Viro
2007-07-16 23:50               ` Satyam Sharma
2007-07-17  9:22           ` Satyam Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.0.999.0707161142210.20061@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ssatyam@cse.iitk.ac.in \
    --cc=viro@ftp.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®