Re: Why is chmod(2)?

Kristian Koehntopp (kris@koehntopp.de)
Wed, 22 Sep 1999 20:45:33 +0200


On Wed, Sep 22, 1999 at 02:38:53AM -0500, Nate Riffe wrote:
> Not exactly. open might come back with an errno of EPERM, in which case
> there is no way to fchmod. Without chmod, there is no way to access the
> file under any non-root circumstances since there is a chicken and egg
> problem regarding fchmod.

That is why I suggested O_NULL and O_EXONLY:

> > Alternatively, you would need
> > something like O_NULL and O_EXONLY as parameters to open(2),
> > along the lines of O_RDONLY and O_RDWR. O_NULL would indicate
> > that you want a file handle as a handle only, to be able to pass
> > it to fchown() and fchmod() which only require that you are the
> > owner of the file in question. O_EXONLY would require that you
> > have execute permission on the file on question and you could
> > use the resulting handle and pass it to fexecve().

Kristian

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