diff options
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 17a362fb5c..5b6759aec0 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1969,17 +1969,32 @@ dev = %x, inode = %.0f\n", iterate_fsp->fnum, (unsigned int)dev, (double)inode)) fname, (double)size )); if (fd == -1) { - fd = conn->vfs_ops.open(conn,dos_to_unix(fname,False),O_RDWR,0); - if (fd == -1) + files_struct *new_fsp = NULL; + int access_mode = 0; + int action = 0; + + if(global_oplock_break) { + /* Queue this file modify as we are the process of an oplock break. */ + + DEBUG(2,("call_trans2setfilepathinfo: queueing message due to being ")); + DEBUGADD(2,( "in oplock break state.\n")); + + push_oplock_pending_smb_message(inbuf, length); + return -1; + } + + new_fsp = open_file_shared(conn, fname, &sbuf, + SET_OPEN_MODE(DOS_OPEN_RDWR), + (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), + 0, 0, &access_mode, &action); + + if (new_fsp == NULL) return(UNIXERROR(ERRDOS,ERRbadpath)); - set_filelen(fd, size); /* tpot vfs */ - conn->vfs_ops.close(fsp,fd); + vfs_set_filelen(new_fsp, size); + close_file(new_fsp,True); } else { - set_filelen(fd, size); /* tpot vfs */ + vfs_set_filelen(fsp, size); } - - if(fsp) - set_filelen_write_cache(fsp, size); } SSVAL(params,0,0); |