mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
s4:smb_server: Use cli_credentials_init_server() for negprot
Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Sep 7 13:22:26 UTC 2020 on sn-devel-184
This commit is contained in:
parent
6c94ebf77f
commit
0b742ec6a0
@ -375,21 +375,21 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
|
||||
const char *oid;
|
||||
NTSTATUS nt_status;
|
||||
|
||||
server_credentials
|
||||
= cli_credentials_init(req);
|
||||
if (!server_credentials) {
|
||||
smbsrv_terminate_connection(req->smb_conn, "Failed to init server credentials\n");
|
||||
return;
|
||||
}
|
||||
|
||||
cli_credentials_set_conf(server_credentials, req->smb_conn->lp_ctx);
|
||||
nt_status = cli_credentials_set_machine_account(server_credentials, req->smb_conn->lp_ctx);
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status)));
|
||||
server_credentials =
|
||||
cli_credentials_init_server(req, req->smb_conn->lp_ctx);
|
||||
if (server_credentials == NULL) {
|
||||
DBG_DEBUG("Failed to obtain server credentials, "
|
||||
"perhaps a standalone server?\n");
|
||||
/*
|
||||
* We keep the server_credentials as anonymous
|
||||
* this is required for the spoolss.notify test
|
||||
* Create anon server credentials for for the
|
||||
* spoolss.notify test.
|
||||
*/
|
||||
server_credentials = cli_credentials_init_anon(req);
|
||||
if (server_credentials == NULL) {
|
||||
smbsrv_terminate_connection(req->smb_conn,
|
||||
"Failed to init server credentials\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
nt_status = samba_server_gensec_start(req,
|
||||
|
@ -39,20 +39,21 @@ static NTSTATUS smb2srv_negprot_secblob(struct smb2srv_request *req, DATA_BLOB *
|
||||
NTSTATUS nt_status;
|
||||
struct cli_credentials *server_credentials;
|
||||
|
||||
server_credentials = cli_credentials_init(req);
|
||||
if (!server_credentials) {
|
||||
smbsrv_terminate_connection(req->smb_conn, "Failed to init server credentials\n");
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
cli_credentials_set_conf(server_credentials, req->smb_conn->lp_ctx);
|
||||
nt_status = cli_credentials_set_machine_account(server_credentials, req->smb_conn->lp_ctx);
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status)));
|
||||
server_credentials =
|
||||
cli_credentials_init_server(req, req->smb_conn->lp_ctx);
|
||||
if (server_credentials == NULL) {
|
||||
DBG_DEBUG("Failed to obtain server credentials, "
|
||||
"perhaps a standalone server?\n");
|
||||
/*
|
||||
* We keep the server_credentials as anonymous
|
||||
* this is required for the spoolss.notify test
|
||||
* Create anon server credentials for for the
|
||||
* spoolss.notify test.
|
||||
*/
|
||||
server_credentials = cli_credentials_init_anon(req);
|
||||
if (server_credentials == NULL) {
|
||||
smbsrv_terminate_connection(req->smb_conn,
|
||||
"Failed to init server credentials\n");
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
req->smb_conn->negotiate.server_credentials = talloc_steal(req->smb_conn, server_credentials);
|
||||
|
Loading…
Reference in New Issue
Block a user