mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: Ulrich Windl <Ulrich.Windl@RZ.Uni-Regensburg.DE>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.2: "filp->f_mode & 2..."
Date: Thu, 12 Feb 2004 11:13:29 +0000	[thread overview]
Message-ID: <20040212111329.GR21151@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <402B4FB2.mailxG23119XFU@pc5234.klinik.uni-regensburg.de>

On Thu, Feb 12, 2004 at 11:04:34AM +0100, Ulrich Windl wrote:
> Hi everybody!
> 
> I think there's one thing to change in kernel sources; consider this:
> filp->f_mode & 2 || permission(filp->f_dentry->d_inode,2,NULL)

filp->f_mode & FMODE_WRITE
permission(...., MAY_WRITE, ...)
> 
> It's obvious to some, likely for others that "2" there really stands for
> "002", the good old UNIX write permission. I'd suggest either to write
> those permission bits in three-digit-octal, or introduce (maybe just use)
> symbolic constants for improved readability.
> 
> One could even consider a macro MAY_WRITE(filp):
> #define MAY_WRITE(filp) ((filp)->f_mode & WRITE_PERMISSION)
> #define WRITE_PERMISSION 002

Grep is such a wondeful thing...

  reply	other threads:[~2004-02-12 11:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-12 10:04 Ulrich Windl
2004-02-12 11:13 ` viro [this message]
2004-02-13  3:32 ` Jamie Lokier

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=20040212111329.GR21151@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=Ulrich.Windl@RZ.Uni-Regensburg.DE \
    --cc=linux-kernel@vger.kernel.org \
    /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®