[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200902120310.n1C3AwHL076677@www262.sakura.ne.jp>
Date: Thu, 12 Feb 2009 12:10:58 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Subject: Description of open_to_namei_flags()?
Hello.
> /*
> * Note that while the flag value (low two bits) for sys_open means:
> * 00 - read-only
> * 01 - write-only
> * 10 - read-write
> * 11 - special
> * it is changed into
> * 00 - no permissions needed
> * 01 - read-permission
> * 10 - write-permission
> * 11 - read-write
> * for the internal routines (ie open_namei()/follow_link() etc)
> * This is more logical, and also allows the 00 "no perm needed"
> * to be used for symlinks (where the permissions are checked
> * later).
> *
> */
> static inline int open_to_namei_flags(int flag)
> {
> if ((flag+1) & O_ACCMODE)
> flag++;
> return flag;
> }
I noticed that open_to_namei_flags() can't yield
"00 - no permissions needed" output for "11 - special" input.
To yield "00 - no permissions needed" output for "11 - special" input,
I think
static inline int open_to_namei_flags(int flag)
{
return (flag + 1) & O_ACCMODE;
}
is needed.
sys_open(path, 0) is open for reading.
sys_open(path, 1) is open for writing.
sys_open(path, 2) is open for reading and writing.
What is sys_open(path, 3) for?
Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists