summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/smb_server')
-rw-r--r--source4/smb_server/negprot.c8
-rw-r--r--source4/smb_server/reply.c41
-rw-r--r--source4/smb_server/trans2.c66
3 files changed, 44 insertions, 71 deletions
diff --git a/source4/smb_server/negprot.c b/source4/smb_server/negprot.c
index 253dc1d7a4..43dc5094df 100644
--- a/source4/smb_server/negprot.c
+++ b/source4/smb_server/negprot.c
@@ -256,13 +256,11 @@ static void reply_nt1(struct request_context *req, uint16 choice)
capabilities |= CAP_UNIX;
}
- if (lp_large_readwrite() && (SMB_OFF_T_BITS == 64)) {
+ if (lp_large_readwrite()) {
capabilities |= CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS;
}
- if (SMB_OFF_T_BITS >= 64) {
- capabilities |= CAP_LARGE_FILES;
- }
+ capabilities |= CAP_LARGE_FILES;
if (lp_readraw() && lp_writeraw()) {
capabilities |= CAP_RAW_MODE;
@@ -320,7 +318,7 @@ static void reply_nt1(struct request_context *req, uint16 choice)
SIVAL(req->out.vwv+1, VWV(5), 0x10000); /* raw size. full 64k */
SIVAL(req->out.vwv+1, VWV(7), req->smb->pid); /* session key */
SIVAL(req->out.vwv+1, VWV(9), capabilities);
- push_nttime(req->out.vwv+1, VWV(11), &nttime);
+ push_nttime(req->out.vwv+1, VWV(11), nttime);
SSVALS(req->out.vwv+1,VWV(15), req->smb->negotiate.zone_offset/60);
if (!negotiate_spnego) {
diff --git a/source4/smb_server/reply.c b/source4/smb_server/reply.c
index 073ee956ca..eab71c519c 100644
--- a/source4/smb_server/reply.c
+++ b/source4/smb_server/reply.c
@@ -672,13 +672,7 @@ void reply_readbraw(struct request_context *req)
/* the 64 bit varient */
if (req->in.wct == 10) {
uint32 offset_high = IVAL(req->in.vwv, VWV(8));
-#ifdef LARGE_SMB_OFF_T
io.readbraw.in.offset |= (((SMB_OFF_T)offset_high) << 32);
-#else
- if (offset_high != 0) {
- goto failed;
- }
-#endif
}
/* before calling the backend we setup the raw buffer. This
@@ -884,14 +878,7 @@ void reply_read_and_X(struct request_context *req)
/* the 64 bit varient */
if (req->in.wct == 12) {
uint32 offset_high = IVAL(req->in.vwv, VWV(10));
-#ifdef LARGE_SMB_OFF_T
- io->readx.in.offset |= (((SMB_OFF_T)offset_high) << 32);
-#else
- if (offset_high != 0) {
- req_reply_error(req, NT_STATUS_FOOBAR);
- return;
- }
-#endif
+ io->readx.in.offset |= (((uint64_t)offset_high) << 32);
}
/* setup the reply packet assuming the maximum possible read */
@@ -1079,14 +1066,7 @@ void reply_write_and_X(struct request_context *req)
if (req->in.wct == 14) {
uint32 offset_high = IVAL(req->in.vwv, VWV(12));
uint16 count_high = SVAL(req->in.vwv, VWV(9));
-#ifdef LARGE_SMB_OFF_T
- io->writex.in.offset |= (((SMB_OFF_T)offset_high) << 32);
-#else
- if (offset_high != 0) {
- req_reply_error(req, NT_STATUS_FOOBAR);
- return;
- }
-#endif
+ io->writex.in.offset |= (((uint64_t)offset_high) << 32);
io->writex.in.count |= ((uint32)count_high) << 16;
}
@@ -1788,13 +1768,8 @@ void reply_lockingX(struct request_context *req)
lck->lockx.in.locks[i].count = IVAL(p, 6);
}
if (ofs_high != 0 || count_high != 0) {
-#ifdef LARGE_SMB_OFF_T
- lck->lockx.in.locks[i].count |= ((SMB_OFF_T)count_high) << 32;
- lck->lockx.in.locks[i].offset |= ((SMB_OFF_T)ofs_high) << 32;
-#else
- req_reply_error(req, NT_STATUS_FOOBAR);
- return;
-#endif
+ lck->lockx.in.locks[i].count |= ((uint64_t)count_high) << 32;
+ lck->lockx.in.locks[i].offset |= ((uint64_t)ofs_high) << 32;
}
p += lck_size;
}
@@ -2204,10 +2179,10 @@ static void reply_ntcreate_and_X_send(struct request_context *req)
/* the rest of the parameters are not aligned! */
SSVAL(req->out.vwv, 5, io->ntcreatex.out.fnum);
SIVAL(req->out.vwv, 7, io->ntcreatex.out.create_action);
- push_nttime(req->out.vwv, 11, &io->ntcreatex.out.create_time);
- push_nttime(req->out.vwv, 19, &io->ntcreatex.out.access_time);
- push_nttime(req->out.vwv, 27, &io->ntcreatex.out.write_time);
- push_nttime(req->out.vwv, 35, &io->ntcreatex.out.change_time);
+ push_nttime(req->out.vwv, 11, io->ntcreatex.out.create_time);
+ push_nttime(req->out.vwv, 19, io->ntcreatex.out.access_time);
+ push_nttime(req->out.vwv, 27, io->ntcreatex.out.write_time);
+ push_nttime(req->out.vwv, 35, io->ntcreatex.out.change_time);
SIVAL(req->out.vwv, 43, io->ntcreatex.out.attrib);
SBVAL(req->out.vwv, 47, io->ntcreatex.out.alloc_size);
SBVAL(req->out.vwv, 55, io->ntcreatex.out.size);
diff --git a/source4/smb_server/trans2.c b/source4/smb_server/trans2.c
index 3a8124bb3b..4ea8bdf55c 100644
--- a/source4/smb_server/trans2.c
+++ b/source4/smb_server/trans2.c
@@ -260,7 +260,7 @@ static NTSTATUS trans2_qfsinfo(struct request_context *req, struct smb_trans2 *t
trans2_setup_reply(req, trans, 0, 18, 0);
- push_nttime(trans->out.data.data, 0, &fsinfo.volume_info.out.create_time);
+ push_nttime(trans->out.data.data, 0, fsinfo.volume_info.out.create_time);
SIVAL(trans->out.data.data, 8, fsinfo.volume_info.out.serial_number);
trans2_append_data_string(req, trans,
&fsinfo.volume_info.out.volume_name,
@@ -408,10 +408,10 @@ static NTSTATUS trans2_fileinfo_fill(struct request_context *req, struct smb_tra
trans2_setup_reply(req, trans, 2, 40, 0);
SSVAL(trans->out.params.data, 0, 0);
- push_nttime(trans->out.data.data, 0, &st->basic_info.out.create_time);
- push_nttime(trans->out.data.data, 8, &st->basic_info.out.access_time);
- push_nttime(trans->out.data.data, 16, &st->basic_info.out.write_time);
- push_nttime(trans->out.data.data, 24, &st->basic_info.out.change_time);
+ push_nttime(trans->out.data.data, 0, st->basic_info.out.create_time);
+ push_nttime(trans->out.data.data, 8, st->basic_info.out.access_time);
+ push_nttime(trans->out.data.data, 16, st->basic_info.out.write_time);
+ push_nttime(trans->out.data.data, 24, st->basic_info.out.change_time);
SIVAL(trans->out.data.data, 32, st->basic_info.out.attrib);
SIVAL(trans->out.data.data, 36, 0); /* padding */
return NT_STATUS_OK;
@@ -445,10 +445,10 @@ static NTSTATUS trans2_fileinfo_fill(struct request_context *req, struct smb_tra
trans2_setup_reply(req, trans, 2, 56, 0);
SSVAL(trans->out.params.data, 0, 0);
- push_nttime(trans->out.data.data, 0, &st->network_open_information.out.create_time);
- push_nttime(trans->out.data.data, 8, &st->network_open_information.out.access_time);
- push_nttime(trans->out.data.data, 16, &st->network_open_information.out.write_time);
- push_nttime(trans->out.data.data, 24, &st->network_open_information.out.change_time);
+ push_nttime(trans->out.data.data, 0, st->network_open_information.out.create_time);
+ push_nttime(trans->out.data.data, 8, st->network_open_information.out.access_time);
+ push_nttime(trans->out.data.data, 16, st->network_open_information.out.write_time);
+ push_nttime(trans->out.data.data, 24, st->network_open_information.out.change_time);
SBVAL(trans->out.data.data, 32, st->network_open_information.out.alloc_size);
SBVAL(trans->out.data.data, 40, st->network_open_information.out.size);
SIVAL(trans->out.data.data, 48, st->network_open_information.out.attrib);
@@ -550,10 +550,10 @@ static NTSTATUS trans2_fileinfo_fill(struct request_context *req, struct smb_tra
trans2_setup_reply(req, trans, 2, 72, 0);
SSVAL(trans->out.params.data, 0, 0);
- push_nttime(trans->out.data.data, 0, &st->all_info.out.create_time);
- push_nttime(trans->out.data.data, 8, &st->all_info.out.access_time);
- push_nttime(trans->out.data.data, 16, &st->all_info.out.write_time);
- push_nttime(trans->out.data.data, 24, &st->all_info.out.change_time);
+ push_nttime(trans->out.data.data, 0, st->all_info.out.create_time);
+ push_nttime(trans->out.data.data, 8, st->all_info.out.access_time);
+ push_nttime(trans->out.data.data, 16, st->all_info.out.write_time);
+ push_nttime(trans->out.data.data, 24, st->all_info.out.change_time);
SIVAL(trans->out.data.data, 32, st->all_info.out.attrib);
SBVAL(trans->out.data.data, 40, st->all_info.out.alloc_size);
SBVAL(trans->out.data.data, 48, st->all_info.out.size);
@@ -930,10 +930,10 @@ static void find_fill_info(struct request_context *req,
trans2_grow_data(req, trans, ofs + 64);
data = trans->out.data.data + ofs;
SIVAL(data, 4, file->directory_info.file_index);
- push_nttime(data, 8, &file->directory_info.create_time);
- push_nttime(data, 16, &file->directory_info.access_time);
- push_nttime(data, 24, &file->directory_info.write_time);
- push_nttime(data, 32, &file->directory_info.change_time);
+ push_nttime(data, 8, file->directory_info.create_time);
+ push_nttime(data, 16, file->directory_info.access_time);
+ push_nttime(data, 24, file->directory_info.write_time);
+ push_nttime(data, 32, file->directory_info.change_time);
SBVAL(data, 40, file->directory_info.size);
SBVAL(data, 48, file->directory_info.alloc_size);
SIVAL(data, 56, file->directory_info.attrib);
@@ -947,10 +947,10 @@ static void find_fill_info(struct request_context *req,
trans2_grow_data(req, trans, ofs + 68);
data = trans->out.data.data + ofs;
SIVAL(data, 4, file->full_directory_info.file_index);
- push_nttime(data, 8, &file->full_directory_info.create_time);
- push_nttime(data, 16, &file->full_directory_info.access_time);
- push_nttime(data, 24, &file->full_directory_info.write_time);
- push_nttime(data, 32, &file->full_directory_info.change_time);
+ push_nttime(data, 8, file->full_directory_info.create_time);
+ push_nttime(data, 16, file->full_directory_info.access_time);
+ push_nttime(data, 24, file->full_directory_info.write_time);
+ push_nttime(data, 32, file->full_directory_info.change_time);
SBVAL(data, 40, file->full_directory_info.size);
SBVAL(data, 48, file->full_directory_info.alloc_size);
SIVAL(data, 56, file->full_directory_info.attrib);
@@ -975,10 +975,10 @@ static void find_fill_info(struct request_context *req,
trans2_grow_data(req, trans, ofs + 94);
data = trans->out.data.data + ofs;
SIVAL(data, 4, file->both_directory_info.file_index);
- push_nttime(data, 8, &file->both_directory_info.create_time);
- push_nttime(data, 16, &file->both_directory_info.access_time);
- push_nttime(data, 24, &file->both_directory_info.write_time);
- push_nttime(data, 32, &file->both_directory_info.change_time);
+ push_nttime(data, 8, file->both_directory_info.create_time);
+ push_nttime(data, 16, file->both_directory_info.access_time);
+ push_nttime(data, 24, file->both_directory_info.write_time);
+ push_nttime(data, 32, file->both_directory_info.change_time);
SBVAL(data, 40, file->both_directory_info.size);
SBVAL(data, 48, file->both_directory_info.alloc_size);
SIVAL(data, 56, file->both_directory_info.attrib);
@@ -999,10 +999,10 @@ static void find_fill_info(struct request_context *req,
trans2_grow_data(req, trans, ofs + 80);
data = trans->out.data.data + ofs;
SIVAL(data, 4, file->id_full_directory_info.file_index);
- push_nttime(data, 8, &file->id_full_directory_info.create_time);
- push_nttime(data, 16, &file->id_full_directory_info.access_time);
- push_nttime(data, 24, &file->id_full_directory_info.write_time);
- push_nttime(data, 32, &file->id_full_directory_info.change_time);
+ push_nttime(data, 8, file->id_full_directory_info.create_time);
+ push_nttime(data, 16, file->id_full_directory_info.access_time);
+ push_nttime(data, 24, file->id_full_directory_info.write_time);
+ push_nttime(data, 32, file->id_full_directory_info.change_time);
SBVAL(data, 40, file->id_full_directory_info.size);
SBVAL(data, 48, file->id_full_directory_info.alloc_size);
SIVAL(data, 56, file->id_full_directory_info.attrib);
@@ -1019,10 +1019,10 @@ static void find_fill_info(struct request_context *req,
trans2_grow_data(req, trans, ofs + 104);
data = trans->out.data.data + ofs;
SIVAL(data, 4, file->id_both_directory_info.file_index);
- push_nttime(data, 8, &file->id_both_directory_info.create_time);
- push_nttime(data, 16, &file->id_both_directory_info.access_time);
- push_nttime(data, 24, &file->id_both_directory_info.write_time);
- push_nttime(data, 32, &file->id_both_directory_info.change_time);
+ push_nttime(data, 8, file->id_both_directory_info.create_time);
+ push_nttime(data, 16, file->id_both_directory_info.access_time);
+ push_nttime(data, 24, file->id_both_directory_info.write_time);
+ push_nttime(data, 32, file->id_both_directory_info.change_time);
SBVAL(data, 40, file->id_both_directory_info.size);
SBVAL(data, 48, file->id_both_directory_info.alloc_size);
SIVAL(data, 56, file->id_both_directory_info.attrib);