summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/auth_domain.c40
-rw-r--r--source4/auth/auth_server.c60
2 files changed, 50 insertions, 50 deletions
diff --git a/source4/auth/auth_domain.c b/source4/auth/auth_domain.c
index 6e28989522..b0dd2612b0 100644
--- a/source4/auth/auth_domain.c
+++ b/source4/auth/auth_domain.c
@@ -118,7 +118,7 @@ static NTSTATUS rpc_resolve_dc(const char *server,
*
**/
-static NTSTATUS connect_to_domain_password_server(struct cli_state **cli,
+static NTSTATUS connect_to_domain_password_server(struct smbcli_state **cli,
const char *server,
const char *setup_creds_as,
uint16_t sec_chan,
@@ -169,7 +169,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli,
return NT_STATUS_NO_LOGON_SERVERS;
/* Attempt connection */
- result = cli_full_connection(cli, lp_netbios_name(), remote_machine,
+ result = smbcli_full_connection(cli, lp_netbios_name(), remote_machine,
&dest_ip, 0, "IPC$", "IPC", "", "", "",0, retry);
if (!NT_STATUS_IS_OK(result)) {
@@ -190,12 +190,12 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli,
* into account also. This patch from "Bjart Kvarme" <bjart.kvarme@usit.uio.no>.
*/
- if(cli_nt_session_open(*cli, PI_NETLOGON) == False) {
+ if(smbcli_nt_session_open(*cli, PI_NETLOGON) == False) {
DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \
-machine %s. Error was : %s.\n", remote_machine, cli_errstr(*cli)));
- cli_nt_session_close(*cli);
- cli_ulogoff(*cli);
- cli_shutdown(*cli);
+machine %s. Error was : %s.\n", remote_machine, smbcli_errstr(*cli)));
+ smbcli_nt_session_close(*cli);
+ smbcli_ulogoff(*cli);
+ smbcli_shutdown(*cli);
release_server_mutex();
return NT_STATUS_NO_LOGON_SERVERS;
}
@@ -207,14 +207,14 @@ machine %s. Error was : %s.\n", remote_machine, cli_errstr(*cli)));
return NT_STATUS_NO_MEMORY;
}
- result = cli_nt_setup_creds(*cli, sec_chan, trust_passwd, &neg_flags, 2);
+ result = smbcli_nt_setup_creds(*cli, sec_chan, trust_passwd, &neg_flags, 2);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(0,("connect_to_domain_password_server: unable to setup the NETLOGON credentials to machine \
%s. Error was : %s.\n", remote_machine, nt_errstr(result)));
- cli_nt_session_close(*cli);
- cli_ulogoff(*cli);
- cli_shutdown(*cli);
+ smbcli_nt_session_close(*cli);
+ smbcli_ulogoff(*cli);
+ smbcli_shutdown(*cli);
release_server_mutex();
return result;
}
@@ -228,7 +228,7 @@ machine %s. Error was : %s.\n", remote_machine, cli_errstr(*cli)));
Utility function to attempt a connection to an IP address of a DC.
************************************************************************/
-static NTSTATUS attempt_connect_to_dc(struct cli_state **cli,
+static NTSTATUS attempt_connect_to_dc(struct smbcli_state **cli,
const char *domain,
struct in_addr *ip,
const char *setup_creds_as,
@@ -260,7 +260,7 @@ static NTSTATUS attempt_connect_to_dc(struct cli_state **cli,
We have been asked to dynamically determine the IP addresses of
the PDC and BDC's for DOMAIN, and query them in turn.
************************************************************************/
-static NTSTATUS find_connect_dc(struct cli_state **cli,
+static NTSTATUS find_connect_dc(struct smbcli_state **cli,
const char *domain,
const char *setup_creds_as,
uint16_t sec_chan,
@@ -297,7 +297,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
{
fstring remote_machine;
NET_USER_INFO_3 info3;
- struct cli_state *cli = NULL;
+ struct smbcli_state *cli = NULL;
NTSTATUS nt_status = NT_STATUS_NO_LOGON_SERVERS;
/*
@@ -333,7 +333,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
* in the info3 structure.
*/
- nt_status = cli_netlogon_sam_network_logon(cli, mem_ctx,
+ nt_status = smbcli_netlogon_sam_network_logon(cli, mem_ctx,
user_info->smb_name.str, user_info->domain.str,
user_info->wksta_name.str, chal,
user_info->lm_resp, user_info->nt_resp,
@@ -366,9 +366,9 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
*/
if (NT_STATUS_IS_OK(status)) {
- if(cli_nt_logoff(&cli, &ctr) == False) {
+ if(smbcli_nt_logoff(&cli, &ctr) == False) {
DEBUG(0,("domain_client_validate: unable to log off user %s in domain \
-%s to Domain controller %s. Error was %s.\n", user, domain, remote_machine, cli_errstr(&cli)));
+%s to Domain controller %s. Error was %s.\n", user, domain, remote_machine, smbcli_errstr(&cli)));
nt_status = NT_STATUS_LOGON_FAILURE;
}
}
@@ -378,9 +378,9 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
to allocate the other_sids and gids structures has been deleted - so
these pointers are no longer valid..... */
- cli_nt_session_close(cli);
- cli_ulogoff(cli);
- cli_shutdown(cli);
+ smbcli_nt_session_close(cli);
+ smbcli_ulogoff(cli);
+ smbcli_shutdown(cli);
release_server_mutex();
return nt_status;
}
diff --git a/source4/auth/auth_server.c b/source4/auth/auth_server.c
index f98825e04b..d66415b525 100644
--- a/source4/auth/auth_server.c
+++ b/source4/auth/auth_server.c
@@ -28,16 +28,16 @@
Support for server level security.
****************************************************************************/
-static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
+static struct smbcli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
{
- struct cli_state *cli = NULL;
+ struct smbcli_state *cli = NULL;
fstring desthost;
struct in_addr dest_ip;
const char *p;
char *pserver;
BOOL connected_ok = False;
- if (!(cli = cli_initialise(cli)))
+ if (!(cli = smbcli_initialise(cli)))
return NULL;
/* security = server just can't function with spnego */
@@ -68,7 +68,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
return NULL;
}
- if (cli_connect(cli, desthost, &dest_ip)) {
+ if (smbcli_connect(cli, desthost, &dest_ip)) {
DEBUG(3,("connected to password server %s\n",desthost));
connected_ok = True;
break;
@@ -78,7 +78,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
if (!connected_ok) {
release_server_mutex();
DEBUG(0,("password server not available\n"));
- cli_shutdown(cli);
+ smbcli_shutdown(cli);
return NULL;
}
@@ -86,7 +86,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
desthost, &dest_ip)) {
release_server_mutex();
DEBUG(1,("password server fails session request\n"));
- cli_shutdown(cli);
+ smbcli_shutdown(cli);
return NULL;
}
@@ -96,10 +96,10 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
DEBUG(3,("got session\n"));
- if (!cli_negprot(cli)) {
+ if (!smbcli_negprot(cli)) {
DEBUG(1,("%s rejected the negprot\n",desthost));
release_server_mutex();
- cli_shutdown(cli);
+ smbcli_shutdown(cli);
return NULL;
}
@@ -107,7 +107,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
!(cli->sec_mode & NEGOTIATE_SECURITY_USER_LEVEL)) {
DEBUG(1,("%s isn't in user level security mode\n",desthost));
release_server_mutex();
- cli_shutdown(cli);
+ smbcli_shutdown(cli);
return NULL;
}
@@ -116,12 +116,12 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
this one...
*/
- if (!cli_session_setup(cli, "", "", 0, "", 0,
+ if (!smbcli_session_setup(cli, "", "", 0, "", 0,
"")) {
DEBUG(0,("%s rejected the initial session setup (%s)\n",
- desthost, cli_errstr(cli)));
+ desthost, smbcli_errstr(cli)));
release_server_mutex();
- cli_shutdown(cli);
+ smbcli_shutdown(cli);
return NULL;
}
@@ -138,9 +138,9 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
static void free_server_private_data(void **private_data_pointer)
{
- struct cli_state **cli = (struct cli_state **)private_data_pointer;
+ struct smbcli_state **cli = (struct smbcli_state **)private_data_pointer;
if (*cli && (*cli)->initialised) {
- cli_shutdown(*cli);
+ smbcli_shutdown(*cli);
}
}
@@ -150,14 +150,14 @@ static void free_server_private_data(void **private_data_pointer)
static void send_server_keepalive(void **private_data_pointer)
{
- struct cli_state **cli = (struct cli_state **)private_data_pointer;
+ struct smbcli_state **cli = (struct smbcli_state **)private_data_pointer;
/* also send a keepalive to the password server if its still
connected */
if (cli && *cli && (*cli)->initialised) {
if (!send_nbt_keepalive((*cli)->fd)) {
DEBUG( 2, ( "password server keepalive failed.\n"));
- cli_shutdown(*cli);
+ smbcli_shutdown(*cli);
}
}
}
@@ -170,7 +170,7 @@ static DATA_BLOB auth_get_challenge_server(const struct auth_context *auth_conte
void **my_private_data,
TALLOC_CTX *mem_ctx)
{
- struct cli_state *cli = server_cryptkey(mem_ctx);
+ struct smbcli_state *cli = server_cryptkey(mem_ctx);
if (cli) {
DEBUG(3,("using password server validation\n"));
@@ -188,7 +188,7 @@ static DATA_BLOB auth_get_challenge_server(const struct auth_context *auth_conte
} else if (cli->secblob.length < 8) {
/* We can't do much if we don't get a full challenge */
DEBUG(2,("make_auth_info_server: Didn't receive a full challenge from server\n"));
- cli_shutdown(cli);
+ smbcli_shutdown(cli);
return data_blob(NULL, 0);
}
@@ -214,7 +214,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
const auth_usersupplied_info *user_info,
auth_serversupplied_info **server_info)
{
- struct cli_state *cli;
+ struct smbcli_state *cli;
static uint8_t badpass[24];
static fstring baduser;
static BOOL tested_password_server = False;
@@ -288,7 +288,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
*/
if ((!tested_password_server) && (lp_paranoid_server_security())) {
- if (cli_session_setup(cli, baduser, (char *)badpass, sizeof(badpass),
+ if (smbcli_session_setup(cli, baduser, (char *)badpass, sizeof(badpass),
(char *)badpass, sizeof(badpass), user_info->domain.str)) {
/*
@@ -302,7 +302,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
with a bad password.\n", cli->desthost));
DEBUG(0,("server_validate: This is broken (and insecure) behaviour. Please do not \
use this machine as the password server.\n"));
- cli_ulogoff(cli);
+ smbcli_ulogoff(cli);
/*
* Password server has the bug.
@@ -310,7 +310,7 @@ use this machine as the password server.\n"));
bad_password_server = True;
return NT_STATUS_LOGON_FAILURE;
}
- cli_ulogoff(cli);
+ smbcli_ulogoff(cli);
}
} else {
@@ -335,27 +335,27 @@ use this machine as the password server.\n"));
if (!user_info->encrypted) {
/* Plaintext available */
- if (!cli_session_setup(cli, user_info->smb_name.str,
+ if (!smbcli_session_setup(cli, user_info->smb_name.str,
(char *)user_info->plaintext_password.data,
user_info->plaintext_password.length,
NULL, 0,
user_info->domain.str)) {
DEBUG(1,("password server %s rejected the password\n", cli->desthost));
- /* Make this cli_nt_error() when the conversion is in */
- nt_status = cli_nt_error(cli);
+ /* Make this smbcli_nt_error() when the conversion is in */
+ nt_status = smbcli_nt_error(cli);
} else {
nt_status = NT_STATUS_OK;
}
} else {
- if (!cli_session_setup(cli, user_info->smb_name.str,
+ if (!smbcli_session_setup(cli, user_info->smb_name.str,
(char *)user_info->lm_resp.data,
user_info->lm_resp.length,
(char *)user_info->nt_resp.data,
user_info->nt_resp.length,
user_info->domain.str)) {
DEBUG(1,("password server %s rejected the password\n", cli->desthost));
- /* Make this cli_nt_error() when the conversion is in */
- nt_status = cli_nt_error(cli);
+ /* Make this smbcli_nt_error() when the conversion is in */
+ nt_status = smbcli_nt_error(cli);
} else {
nt_status = NT_STATUS_OK;
}
@@ -367,7 +367,7 @@ use this machine as the password server.\n"));
nt_status = NT_STATUS_LOGON_FAILURE;
}
- cli_ulogoff(cli);
+ smbcli_ulogoff(cli);
if NT_STATUS_IS_OK(nt_status) {
struct passwd *pass = Get_Pwnam(user_info->internal_username.str);
@@ -379,7 +379,7 @@ use this machine as the password server.\n"));
}
if (locally_made_cli) {
- cli_shutdown(cli);
+ smbcli_shutdown(cli);
}
return(nt_status);