This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: chown


At 12:58 PM 4/15/2004 -0400, Pierre A. Humblet wrote:
>Corinna Vinschen wrote:
>> I'd love to remove it.  I have no idea if NtSetSecurityObject is atomic,
>> though.  I'd guess so but knowledge would require documentation...
>
>I looked up the acl after the failed chown. It hasn't changed.
>So the call looks atomic.

Sorry, that was a stupid conclusion. I have modified the code
and will test tomorrow.
 
>> Why not?  The code to set SE_RESTORE_NAME could easily be moved out
>> of write_sd and into fhandler_disk_file's fchown, fchmod and facl
>> methods.  That would allow to reduce fchown and fchmod back to
>> just calling open_fs with query_write_control since that's required
>> for that functionality anyway.

Sure. And if that function is called even if the handle is already
open, then there is no need to call it again from write_sd.
 
>At this point the simplest strategy (if it works)
It doesn't... 

There are related problems on 9x:

~: chmod a+x .bash_profile 
chmod: changing permissions of `.bash_profile': Invalid argument

  361  141727 [main] chmod 638037 fhandler_base::open:
(c:\HOME\Pierre\.bash_profile, 0x110000) query_open 3
  192  141919 [main] chmod 638037 seterrno_from_win_error:
../../../../src/winsup/cygwin/fhandler.cc:546 windows error 87

#define ERROR_INVALID_PARAMETER 87L

We need a wincap.has_security () around file opening in
chmod. Probably ditto in the fchown system call.

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]