lkml.org 
[lkml]   [2004]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.2: "filp->f_mode & 2..."
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...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.042 / U:2.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site