s3-libsmb/passchange.c: remove some cli_nt_error() calls
[gd/samba-autobuild/.git] / source3 / libsmb / passchange.c
index bf2103db6845179a80e5266d7cacf7db46191ebb..83fd9ebf1fc79aec32c4385152a8515f7b271015 100644 (file)
@@ -56,7 +56,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
        *err_str = NULL;
 
        result = cli_connect_nb(remote_machine, NULL, 0, 0x20, NULL,
-                               Undefined, &cli);
+                               SMB_SIGNING_DEFAULT, 0, &cli);
        if (!NT_STATUS_IS_OK(result)) {
                if (asprintf(err_str, "Unable to connect to SMB server on "
                         "machine %s. Error was : %s.\n",
@@ -66,9 +66,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
                return result;
        }
 
-       cli->protocol = PROTOCOL_NT1;
-
-       result = cli_negprot(cli);
+       result = cli_negprot(cli, PROTOCOL_NT1);
 
        if (!NT_STATUS_IS_OK(result)) {
                if (asprintf(err_str, "machine %s rejected the negotiate "
@@ -76,7 +74,6 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
                         remote_machine, nt_errstr(result)) == -1) {
                        *err_str = NULL;
                }
-               result = cli_nt_error(cli);
                cli_shutdown(cli);
                return result;
        }
@@ -191,7 +188,6 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
                                 remote_machine, nt_errstr(result)) == -1) {
                                *err_str = NULL;
                        }
-                       result = cli_nt_error(cli);
                        cli_shutdown(cli);
                        return result;
                }