tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: O_DIRECTORY



On Sep 13, 2010, at 12:58 39PM, David Laight wrote:

> On Sat, Sep 11, 2010 at 02:01:43PM -0700, Chuck Silvers wrote:
>> hi folks,
>> 
>> the remaining missing bit that prevents acroread from working with the new
>> linux emulation code (PR 43695) is support for the O_DIRECTORY flag to 
>> open().
> 
> Is there a way to open a directory on which you have neither read nor
> write access (maybe not even search access) ?

You can only open something for which you have *some* access right.  
Traditionally, Unix has done access rights checking only at open time, not at 
read/write/chdir time.

> Sometimes it is necessary to open "." in order to do a later fchdir().
> And if/when we support apenat() then you have a good justification for
> only requiring 'x' access.
> 
This poses an interesting question -- what flags should go in the open() call 
to permit search path but not read?  (Btw -- I assume you meant openat(), not 
apenat().)
> 


                --Steve Bellovin, http://www.cs.columbia.edu/~smb







Home | Main Index | Thread Index | Old Index