Reply for the lanman 1.0 protocol.
****************************************************************************/
-static void reply_lanman1(struct smb_request *req, uint16_t choice)
+static NTSTATUS reply_lanman1(struct smb_request *req, uint16_t choice)
{
int secword=0;
time_t t = time(NULL);
status = smbXsrv_connection_init_tables(xconn, PROTOCOL_LANMAN1);
if (!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);
- return;
+ return status;
}
/* Reply, SMBlockread, SMBwritelock supported. */
srv_put_dos_date((char *)req->outbuf,smb_vwv8,t);
- return;
+ return NT_STATUS_OK;
}
/****************************************************************************
Reply for the lanman 2.0 protocol.
****************************************************************************/
-static void reply_lanman2(struct smb_request *req, uint16_t choice)
+static NTSTATUS reply_lanman2(struct smb_request *req, uint16_t choice)
{
int secword=0;
time_t t = time(NULL);
status = smbXsrv_connection_init_tables(xconn, PROTOCOL_LANMAN2);
if (!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);
- return;
+ return status;
}
/* Reply, SMBlockread, SMBwritelock supported. */
SSVAL(req->outbuf,smb_vwv5,raw); /* readbraw and/or writebraw */
SSVAL(req->outbuf,smb_vwv10, set_server_zone_offset(t)/60);
srv_put_dos_date((char *)req->outbuf,smb_vwv8,t);
+ return NT_STATUS_OK;
}
/****************************************************************************
Reply for the nt protocol.
****************************************************************************/
-static void reply_nt1(struct smb_request *req, uint16_t choice)
+static NTSTATUS reply_nt1(struct smb_request *req, uint16_t choice)
{
/* dual names + lock_and_read + nt SMBs + remote API calls */
int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ|
status = smbXsrv_connection_init_tables(xconn, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);
- return;
+ return status;
}
SSVAL(req->outbuf,smb_vwv1+1, lp_max_mux()); /* maxmpx */
if (ret == -1) {
DEBUG(0, ("Could not push challenge\n"));
reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
+ return NT_STATUS_NO_MEMORY;
}
SCVAL(req->outbuf, smb_vwv16+1, ret);
}
if (ret == -1) {
DEBUG(0, ("Could not push workgroup string\n"));
reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
+ return NT_STATUS_NO_MEMORY;
}
ret = message_push_string(&req->outbuf, lp_netbios_name(),
STR_UNICODE|STR_TERMINATE
if (ret == -1) {
DEBUG(0, ("Could not push netbios name string\n"));
reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
+ return NT_STATUS_NO_MEMORY;
}
DEBUG(3,("not using SPNEGO\n"));
} else {
if (spnego_blob.data == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
+ return NT_STATUS_NO_MEMORY;
}
ret = message_push_blob(&req->outbuf, spnego_blob);
if (ret == -1) {
DEBUG(0, ("Could not push spnego blob\n"));
reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
+ return NT_STATUS_NO_MEMORY;
}
data_blob_free(&spnego_blob);
DEBUG(3,("using SPNEGO\n"));
}
- return;
+ return NT_STATUS_OK;
}
/* these are the protocol lists used for auto architecture detection:
static const struct {
const char *proto_name;
const char *short_name;
- void (*proto_reply_fn)(struct smb_request *req, uint16_t choice);
+ NTSTATUS (*proto_reply_fn)(struct smb_request *req, uint16_t choice);
int protocol_level;
} supported_protocols[] = {
{"SMB 2.???", "SMB2_FF", reply_smb20ff, PROTOCOL_SMB2_10},
* this is the entry point if SMB2 is selected via
* the SMB negprot and the "SMB 2.002" dialect.
*/
-void reply_smb2002(struct smb_request *req, uint16_t choice)
+NTSTATUS reply_smb2002(struct smb_request *req, uint16_t choice)
{
- reply_smb20xx(req, SMB2_DIALECT_REVISION_202);
+ return reply_smb20xx(req, SMB2_DIALECT_REVISION_202);
}
/*
* this is the entry point if SMB2 is selected via
* the SMB negprot and the "SMB 2.???" dialect.
*/
-void reply_smb20ff(struct smb_request *req, uint16_t choice)
+NTSTATUS reply_smb20ff(struct smb_request *req, uint16_t choice)
{
struct smbXsrv_connection *xconn = req->xconn;
xconn->smb2.allow_2ff = true;
- reply_smb20xx(req, SMB2_DIALECT_REVISION_2FF);
+ return reply_smb20xx(req, SMB2_DIALECT_REVISION_2FF);
}
enum protocol_types smbd_smb2_protocol_dialect_match(const uint8_t *indyn,