summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-21 19:57:41 +0100
committerVolker Lendecke <vl@samba.org>2009-11-21 20:49:17 +0100
commitc85a4c9ba4a7de65a7850f6f9708df66bd24deea (patch)
tree5205ef1da477ed65127276d684cf48a7edfbe7d5 /source3/smbd/reply.c
parent6a149022976fe6a5579ec9afc7a4d2dcb44dc8af (diff)
downloadsamba-c85a4c9ba4a7de65a7850f6f9708df66bd24deea.tar.gz
samba-c85a4c9ba4a7de65a7850f6f9708df66bd24deea.tar.bz2
samba-c85a4c9ba4a7de65a7850f6f9708df66bd24deea.zip
s3: Move the global variable Protocol to struct smbd_server_connection
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 0b77d82edd..49d7497ff3 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -785,7 +785,7 @@ void reply_tcon_and_X(struct smb_request *req)
else
server_devicetype = "A:";
- if (get_Protocol() < PROTOCOL_NT1) {
+ if (get_Protocol(req->sconn) < PROTOCOL_NT1) {
reply_outbuf(req, 2, 0);
if (message_push_string(&req->outbuf, server_devicetype,
STR_TERMINATE|STR_ASCII) == -1) {
@@ -1139,7 +1139,7 @@ void reply_getatr(struct smb_request *req)
}
SIVAL(req->outbuf,smb_vwv3,(uint32)size);
- if (get_Protocol() >= PROTOCOL_NT1) {
+ if (get_Protocol(req->sconn) >= PROTOCOL_NT1) {
SSVAL(req->outbuf, smb_flg2,
SVAL(req->outbuf, smb_flg2) | FLAGS2_IS_LONG_NAME);
}
@@ -1264,7 +1264,7 @@ void reply_dskattr(struct smb_request *req)
reply_outbuf(req, 5, 0);
- if (get_Protocol() <= PROTOCOL_LANMAN2) {
+ if (get_Protocol(req->sconn) <= PROTOCOL_LANMAN2) {
double total_space, free_space;
/* we need to scale this to a number that DOS6 can handle. We
use floating point so we can handle large drives on systems
@@ -2638,7 +2638,8 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
continue;
}
- if(!mask_match(dname, fname_mask, get_Protocol(),
+ if(!mask_match(dname, fname_mask,
+ get_Protocol(conn->sconn),
conn->case_sensitive)) {
TALLOC_FREE(frame);
TALLOC_FREE(talloced);
@@ -2925,7 +2926,7 @@ static void send_file_readbraw(connection_struct *conn,
if ( !req_is_in_chain(req) && (nread > 0) && (fsp->base_fsp == NULL) &&
(fsp->wcp == NULL) &&
- lp_use_sendfile(SNUM(conn), get_Protocol(),
+ lp_use_sendfile(SNUM(conn), get_Protocol(conn->sconn),
smbd_server_conn->smb1.signing_state) ) {
ssize_t sendfile_read = -1;
char header[4];
@@ -3453,7 +3454,7 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
if (!req_is_in_chain(req) &&
!is_encrypted_packet(req->inbuf) && (fsp->base_fsp == NULL) &&
(fsp->wcp == NULL) &&
- lp_use_sendfile(SNUM(conn), get_Protocol(),
+ lp_use_sendfile(SNUM(conn), get_Protocol(conn->sconn),
smbd_server_conn->smb1.signing_state) ) {
uint8 headerbuf[smb_size + 12 * 2];
DATA_BLOB header;
@@ -3775,7 +3776,7 @@ void reply_writebraw(struct smb_request *req)
/* We have to deal with slightly different formats depending
on whether we are using the core+ or lanman1.0 protocol */
- if(get_Protocol() <= PROTOCOL_COREPLUS) {
+ if(get_Protocol(req->sconn) <= PROTOCOL_COREPLUS) {
numtowrite = SVAL(smb_buf(req->inbuf),-2);
data = smb_buf(req->inbuf);
} else {
@@ -3831,7 +3832,9 @@ void reply_writebraw(struct smb_request *req)
* it to send more bytes */
memcpy(buf, req->inbuf, smb_size);
- srv_set_message(buf,get_Protocol()>PROTOCOL_COREPLUS?1:0,0,True);
+ srv_set_message(
+ buf, get_Protocol(req->sconn) > PROTOCOL_COREPLUS ? 1 : 0, 0,
+ True);
SCVAL(buf,smb_com,SMBwritebraw);
SSVALS(buf,smb_vwv0,0xFFFF);
show_msg(buf);
@@ -5447,7 +5450,8 @@ NTSTATUS rmdir_internals(TALLOC_CTX *ctx,
TALLOC_FREE(talloced);
continue;
}
- if(!is_in_path(dname, conn->veto_list, get_Protocol(),
+ if(!is_in_path(dname, conn->veto_list,
+ get_Protocol(conn->sconn),
conn->case_sensitive)) {
TALLOC_FREE(dir_hnd);
TALLOC_FREE(talloced);
@@ -6340,7 +6344,8 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
continue;
}
- if(!mask_match(dname, fname_src_mask, get_Protocol(),
+ if(!mask_match(dname, fname_src_mask,
+ get_Protocol(conn->sconn),
conn->case_sensitive)) {
TALLOC_FREE(talloced);
continue;
@@ -6972,7 +6977,8 @@ void reply_copy(struct smb_request *req)
continue;
}
- if(!mask_match(dname, fname_src_mask, get_Protocol(),
+ if(!mask_match(dname, fname_src_mask,
+ get_Protocol(conn->sconn),
conn->case_sensitive)) {
TALLOC_FREE(talloced);
continue;