getcwd() and friends.
    Guy Harris 
    guy at auspex.auspex.com
       
    Tue Apr 11 06:02:59 AEST 1989
    
    
  
>>>For one thing, we could introduce O_CHMOD to open for mode changes.
>>No, not worth it.  "fchmod" can - and does - already check whether you
>>have permission to do a "chmod".
>
>Er, the point is to fchmod a file that you don't have permission to
>open.  You need to open a file for no access (O_OPEN?).
Er, the complaint wasn't that you don't need a new flavor of open, the
complaint was that you don't need a new flavor of open *that's specific
to "chmod", and that does permission checking*.  From the article to
which I was replying:
	For one thing, we could introduce O_CHMOD to open for mode
	changes.  The open would succeed iff the opener had
	permission to do a chmod.
O_OPEN is *all* you need; you don't need O_CHMOD and O_CHOWN and O_this
and O_that, since the call that uses the file descriptor can check the
permissions itself (and does, in the case of "fchmod", for example). 
O_CHMOD doesn't buy you anything worthwhile that O_OPEN doesn't;
assuming it's worth adding O_OPEN, it's not worth adding O_CHOWN.
    
    
More information about the Comp.unix.wizards
mailing list