[PATCH] Deny file rename if file has open streams

Jeremy Allison jra at samba.org
Tue May 29 21:21:01 UTC 2018


On Tue, May 29, 2018 at 02:12:40PM -0700, Jeremy Allison via samba-technical wrote:
> On Sun, May 27, 2018 at 04:57:54PM +0200, Ralph Böhme via samba-technical wrote:
> > Hi!
> > 
> > Just stumpled across this one: Windows denies renaming a file that has open
> > streams with NT_STATUS_ACCESS_DENIED.
> > 
> > Please review & push if happy.
> 
> Only one comment, you've dupicated:
> 
> +#define NTCREATEX_OPTIONS_PRIVATE_STREAM_BASEOPEN 0x0008
> 
> with the existing:
> 
>  /* Private options for printer support */
>  #define NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE 0x0008
> 
> Was this intentional ? They shouldn't conflict as
> NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE is only used for
> printer handles, but I'm thinking it'd be safer to set
> NTCREATEX_OPTIONS_PRIVATE_STREAM_BASEOPEN to be 0x0010 instead.

Hmmm. Interestingly enough, I don't see the
fsp->fh->private_options |= NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE
actually being *used* anywhere in the printing code
for close, but it's still safer to use a new
value IMHO.



More information about the samba-technical mailing list