summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-28 20:45:11 +0200
committerVolker Lendecke <vl@samba.org>2011-05-28 20:50:10 +0200
commit06eec02e746860fb55901b65da44f50c35b48568 (patch)
tree97c19c491b3588eac3881e159d0770c7af90e2a2 /source3
parent57ae32794f841365a73f22df3b872eb001c21abc (diff)
downloadsamba-06eec02e746860fb55901b65da44f50c35b48568.tar.gz
samba-06eec02e746860fb55901b65da44f50c35b48568.tar.bz2
samba-06eec02e746860fb55901b65da44f50c35b48568.zip
s3: Use cli_connect_nb in remote_password_change
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/passchange.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c
index 3c349bc8c8..bf2103db68 100644
--- a/source3/libsmb/passchange.c
+++ b/source3/libsmb/passchange.c
@@ -33,10 +33,8 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
const char *old_passwd, const char *new_passwd,
char **err_str)
{
- struct nmb_name calling, called;
struct cli_state *cli = NULL;
struct rpc_pipe_client *pipe_hnd = NULL;
- struct sockaddr_storage ss;
char *user, *domain, *p;
NTSTATUS result;
@@ -57,41 +55,14 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
*err_str = NULL;
- if(!resolve_name( remote_machine, &ss, 0x20, false)) {
- if (asprintf(err_str, "Unable to find an IP address for machine "
- "%s.\n", remote_machine) == -1) {
- *err_str = NULL;
- }
- return NT_STATUS_UNSUCCESSFUL;
- }
-
- cli = cli_initialise();
- if (!cli) {
- return NT_STATUS_NO_MEMORY;
- }
-
- result = cli_connect(cli, remote_machine, &ss);
+ result = cli_connect_nb(remote_machine, NULL, 0, 0x20, NULL,
+ Undefined, &cli);
if (!NT_STATUS_IS_OK(result)) {
if (asprintf(err_str, "Unable to connect to SMB server on "
"machine %s. Error was : %s.\n",
remote_machine, nt_errstr(result))==-1) {
*err_str = NULL;
}
- cli_shutdown(cli);
- return result;
- }
-
- make_nmb_name(&calling, global_myname() , 0x0);
- make_nmb_name(&called , remote_machine, 0x20);
-
- if (!cli_session_request(cli, &calling, &called)) {
- result = cli_nt_error(cli);
- if (asprintf(err_str, "machine %s rejected the session setup. "
- "Error was : %s.\n",
- remote_machine, nt_errstr(result)) == -1) {
- *err_str = NULL;
- }
- cli_shutdown(cli);
return result;
}