delete on close problems - more info

Nir Livni nirl at cyber-ark.com
Mon Jan 6 13:43:00 GMT 2003


It also seems that if user A opens a file,
and after a while calls trans2setpathinfo or trans2setfileinfo and sets the
DELETE_ON_CLOSE flags,
 
then when user B closes that file (user B did NOT open it to delete on
close) the file will be deleted.

-----Original Message-----
From: Nir Livni 
Sent: Monday, January 06, 2003 2:49 PM
To: 'samba-technical at samba.org'
Subject: delete on close problems


I've noticed that if user A has opened a file with GENERIC_READ , 
 
SHARE_READ | SHARE_DELETE ,
 
FILE_FLAG_DELETE_ON_CLOSE
 
then user B cannot open the file for reading. samba will return error code :
NT_STATUS_DELETE_PENDING, and it is mentioned in the code that -
"this is a nasty hack, but necessary until we rewrite our open
           handling to use a NTCreateX call as the basic call.
           NT may open a file with neither read nor write access, and in
                   this case it expects the open not to conflict with any
                   existing deny modes. This happens (for example) during a
                   "xcopy /o" where the second file descriptor is used for
                   ACL sets
                   (tridge)"
 
 
BUT
 
if user B opens the file for read (and SHARE_READ | SHARE_DELETE) and only
then user A opens the file for DELETE_ON_CLOSE,
both open requests succeed.
 
1. Is this behaviour normal ?
 
2. Could it be that in scenario similar to scenario B a file will be deleted
by the user that hasn't opened it to DELETE_ON_CLOSE ?
 
I'm asking that because I had two users messing up with the same excel file,
and it was deleted ...
 
Thanks,
Nir

 

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the samba-technical mailing list