GetTimeOfDay(&fsp->open_time);
fsp->vuid = current_vuid;
fsp->fh->pos = -1;
- fsp->can_lock = True;
+ fsp->can_lock = False;
fsp->can_read = False;
fsp->access_mask = FILE_GENERIC_WRITE;
fsp->can_write = True;
{
SMB_STRUCT_STAT st;
+ if (offset & 0xffffffff00000000LL) {
+ /* offset is > 4G, skip */
+ return offset;
+ }
+
if (sys_fstat(fsp->fh->fd, &st, false) == -1) {
DEBUG(3,("printfile_offset: sys_fstat failed on %s (%s)\n",
fsp_str_dbg(fsp),
return;
}
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else {
+ if (!fsp->print_file) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)tcount, WRITE_LOCK,
&lock);
startpos = IVAL_TO_SMB_OFF_T(req->vwv+2, 0);
data = (const char *)req->buf + 3;
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else if (numtowrite) {
+ if (!fsp->print_file && numtowrite > 0) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
startpos = IVAL_TO_SMB_OFF_T(req->vwv+2, 0);
data = (const char *)req->buf + 3;
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else {
+ if (!fsp->print_file) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
mtime = convert_time_t_to_timespec(srv_make_unix_date3(req->vwv+4));
data = (const char *)req->buf + 1;
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else if (numtowrite) {
+ if (!fsp->print_file) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);