Re: Why is chmod(2)?

Werner Almesberger (almesber@lrc.di.epfl.ch)
Thu, 23 Sep 1999 15:59:28 +0200


Mitchell Blank Jr wrote:
> I am *very* wary of this idea. A year or two ago there was a big hole
> in the BSD's because you could do:
> i = open("foo", 0)
> without any access to "foo" and get a filedescriptor without read or
> write access.

Try it on Linux ;-) O_RDONLY is 0, O_WRONLY is 1, O_RDWR is 2, O_NOACCESS
is 3. In order to open anything with O_NOACCESS, you're required to have
both read _and_ write access.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_R_131__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/