[lkml]   [2009]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFC] O_NOACC: open without any access
    On Tue, 23 Jun 2009, Christoph Hellwig wrote:
    > On Tue, Jun 23, 2009 at 04:12:22PM +0200, Miklos Szeredi wrote:
    > > > an issue ioctls + stat / etc on it ut not actually read/write it.
    > >
    > > Two differences between open("foo", 3) and open("foo", O_NOACC):
    > >
    > > 1) open with "3" requires _read_and_write_ permissions on foo, but
    > > does not allow either read or write. Not sure what the logic in
    > > that, but that's the way it has always been.
    > Which is a quite sensible requirement if we want to do ioctls.

    Right, but that makes it useless for things which want to open it
    despite having no permission on the file. For example some programs

    fd = open(".", 0);
    /* do something */

    or for that matter:

    fd = open("foo", 0);
    fstat(fd, &stat1);
    if (something)
    fchmod(fd, ...);

    Note: neither chmod() nor chdir() (nor host of others) require either
    read or write permissions on the file, so we _should_ be able to do
    this kind of thing without open() requiring them.


     \ /
      Last update: 2009-06-23 17:15    [W:0.018 / U:41.012 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site