else
server_devicetype = "A:";
- if (get_Protocol() < PROTOCOL_NT1) {
+ if (xconn->protocol < PROTOCOL_NT1) {
reply_smb1_outbuf(req, 2, 0);
if (message_push_string(&req->outbuf, server_devicetype,
STR_TERMINATE|STR_ASCII) == -1) {
void reply_getatr(struct smb_request *req)
{
+ struct smbXsrv_connection *xconn = req->xconn;
connection_struct *conn = req->conn;
struct smb_filename *smb_fname = NULL;
char *fname = NULL;
}
SIVAL(req->outbuf,smb_vwv3,(uint32_t)size);
- if (get_Protocol() >= PROTOCOL_NT1) {
+ if (xconn->protocol >= PROTOCOL_NT1) {
SSVAL(req->outbuf, smb_flg2,
SVAL(req->outbuf, smb_flg2) | FLAGS2_IS_LONG_NAME);
}
void reply_dskattr(struct smb_request *req)
{
+ struct smbXsrv_connection *xconn = req->xconn;
connection_struct *conn = req->conn;
uint64_t ret;
uint64_t dfree,dsize,bsize;
reply_smb1_outbuf(req, 5, 0);
- if (get_Protocol() <= PROTOCOL_LANMAN2) {
+ if (xconn->protocol <= 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
Ensure we don't use sendfile if server smb signing is active.
********************************************************************/
-static bool lp_use_sendfile(int snum, struct smb1_signing_state *signing_state)
+static bool lp_use_sendfile(struct smbXsrv_connection *xconn,
+ int snum,
+ struct smb1_signing_state *signing_state)
{
bool sign_active = false;
/* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */
- if (get_Protocol() < PROTOCOL_NT1) {
+ if (xconn->protocol < PROTOCOL_NT1) {
return false;
}
if (signing_state) {
if ( !req_is_in_chain(req) &&
(nread > 0) &&
!fsp_is_alternate_stream(fsp) &&
- lp_use_sendfile(SNUM(conn), xconn->smb1.signing_state) ) {
+ lp_use_sendfile(xconn, SNUM(conn), xconn->smb1.signing_state) ) {
ssize_t sendfile_read = -1;
char header[4];
DATA_BLOB header_blob;
if (!req_is_in_chain(req) &&
!req->encrypted &&
!fsp_is_alternate_stream(fsp) &&
- lp_use_sendfile(SNUM(conn), xconn->smb1.signing_state) ) {
+ lp_use_sendfile(xconn, SNUM(conn), xconn->smb1.signing_state) ) {
uint8_t headerbuf[smb_size + 12 * 2 + 1 /* padding byte */];
DATA_BLOB header;
/* 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(xconn->protocol <= PROTOCOL_COREPLUS) {
numtowrite = SVAL(smb_buf_const(req->inbuf),-2);
data = smb_buf_const(req->inbuf);
} else {
* it to send more bytes */
memcpy(buf, req->inbuf, smb_size);
- srv_smb1_set_message(buf,get_Protocol()>PROTOCOL_COREPLUS?1:0,0,True);
+ srv_smb1_set_message(buf,xconn->protocol>PROTOCOL_COREPLUS?1:0,0,True);
SCVAL(buf,smb_com,SMBwritebraw);
SSVALS(buf,smb_vwv0,0xFFFF);
show_msg(buf);
struct ea_list *ea_list = NULL;
NTSTATUS ntstatus = NT_STATUS_OK;
bool ask_sharemode;
+ struct smbXsrv_connection *xconn = req->xconn;
struct smbd_server_connection *sconn = req->sconn;
uint32_t ucf_flags = ucf_flags_from_smb_request(req);
bool backup_priv = false;
if (fsp != NULL) {
close_file_free(NULL, &fsp, NORMAL_CLOSE);
}
- if (get_Protocol() < PROTOCOL_NT1) {
+ if (xconn->protocol < PROTOCOL_NT1) {
reply_force_doserror(req, ERRDOS, ERRnofiles);
goto out;
} else {
static void handle_trans2(connection_struct *conn, struct smb_request *req,
struct trans_state *state)
{
- if (get_Protocol() >= PROTOCOL_NT1) {
+ struct smbXsrv_connection *xconn = req->xconn;
+
+ if (xconn->protocol >= PROTOCOL_NT1) {
req->flags2 |= 0x40; /* IS_LONG_NAME */
SSVAL((discard_const_p(uint8_t, req->inbuf)),smb_flg2,req->flags2);
}