diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 4b22a0a703d..0c4d3995616 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2745,6 +2745,17 @@ static NTSTATUS delay_for_oplock(files_struct *fsp, *poplock_type = NO_OPLOCK; *pgranted = 0; + if (fsp->fsp_flags.is_directory) { + /* + * No directory leases yet + */ + SMB_ASSERT(oplock_request == NO_OPLOCK); + if (have_sharing_violation) { + return NT_STATUS_SHARING_VIOLATION; + } + return NT_STATUS_OK; + } + if (oplock_request == LEASE_OPLOCK) { if (lease == NULL) { /*