diff options
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/rpcclient.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 10a1741207..c4be970ac3 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -736,6 +736,7 @@ out_free: fstring new_workgroup; int result = 0; TALLOC_CTX *frame = talloc_stackframe(); + uint32_t flags = 0; /* make sure the vars that get altered (4th field) are in a fixed location or certain compilers complain */ @@ -827,6 +828,12 @@ out_free: * from stdin if necessary */ + if (get_cmdline_auth_info_use_machine_account() && + !set_cmdline_auth_info_machine_account_creds()) { + result = 1; + goto done; + } + if (!get_cmdline_auth_info_got_pass()) { char *pass = getpass("Password:"); if (pass) { @@ -839,13 +846,19 @@ out_free: server += 2; } + if (get_cmdline_auth_info_use_kerberos()) { + flags |= CLI_FULL_CONNECTION_USE_KERBEROS | + CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS; + } + + nt_status = cli_full_connection(&cli, global_myname(), server, opt_ipaddr ? &server_ss : NULL, opt_port, "IPC$", "IPC", get_cmdline_auth_info_username(), lp_workgroup(), get_cmdline_auth_info_password(), - get_cmdline_auth_info_use_kerberos() ? CLI_FULL_CONNECTION_USE_KERBEROS : 0, + flags, get_cmdline_auth_info_signing_state(),NULL); if (!NT_STATUS_IS_OK(nt_status)) { |