[PATCH] Deny file rename if file has open streams

Ralph Böhme slow at samba.org
Wed May 30 09:02:46 UTC 2018


On Tue, May 29, 2018 at 05:00:09PM -0700, Jeremy Allison wrote:
> 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.
> 
> Ah. Some code got dropped going from Samba 3.0.x to 3.5.x,
> - when we moved from print_fsp_end() -> print_spool_end().
> 
> This means setting "delete on close" on a print file
> handle to cancel the job hasn't worked for a *long* time :-).
> 
> Here's the raw fix - now I just need to work out how
> to test this, log a bug and submit it as a real fix
> to samba-technical :-).

good catch, so at least my mistake had it's positive side effect. :)

-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG Key Fingerprint:           FAE2 C608 8A24 2520 51C5
                               59E4 AA1E 9B71 2639 9E46



More information about the samba-technical mailing list