Re: Why is chmod(2)?

sergey@memco.com
Thu, 23 Sep 1999 13:30:42 -0400


Werner Almesberger <almesber@lrc.di.epfl.ch> on 09/23/99 06:59:28 AM

To: Mitchell Blank Jr <mitch@sfgoth.com>
cc: Kristian Koehntopp <kris@koehntopp.de>, Jamie Lokier
<lkd@tantalophile.demon.co.uk>, linux-kernel@vger.rutgers.edu (bcc: Sergey
Tsybanov/San Jose/Memco Software)

Subject: Re: Why is chmod(2)?

Hi !

Semantics of O_RDONLY was always zero since UNIX 6 at least. Identificator of
O_RDONLY was appeared in UNIX 7.
The only two problems I see here.
1. bad driver writers.
2. O_NOACCESS feature itself.

Sergey Tsybanov

Original message:

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/

- 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/