summaryrefslogtreecommitdiff
path: root/source3/rpcclient/rpcclient.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-05 16:58:24 +0200
committerGünther Deschner <gd@samba.org>2008-05-05 16:59:53 +0200
commit4d8836ab96889bcdc35e86bedffa6117f9c35095 (patch)
tree381e8fe6d2d2efd6da763bdd238f8a5fac8acf44 /source3/rpcclient/rpcclient.c
parent1a3f50559e06c9dc45556c2c52d68a23c05d7e41 (diff)
downloadsamba-4d8836ab96889bcdc35e86bedffa6117f9c35095.tar.gz
samba-4d8836ab96889bcdc35e86bedffa6117f9c35095.tar.bz2
samba-4d8836ab96889bcdc35e86bedffa6117f9c35095.zip
Fix client authentication with -P switch in client tools (Bug 5435).
Guenther (This used to be commit d077ef64cd1d9bbaeb936566c2c70da508de829f)
Diffstat (limited to 'source3/rpcclient/rpcclient.c')
-rw-r--r--source3/rpcclient/rpcclient.c15
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)) {