summaryrefslogtreecommitdiff
path: root/source3/lib/popt_common.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/lib/popt_common.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/lib/popt_common.c')
-rw-r--r--source3/lib/popt_common.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index 8f0f7c62bb..25e41ab5f3 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -514,35 +514,7 @@ static void popt_common_credentials_callback(poptContext con,
}
break;
case 'P':
- {
- char *opt_password = NULL;
- char *pwd = NULL;
-
- /* it is very useful to be able to make ads queries as the
- machine account for testing purposes and for domain leave */
-
- if (!secrets_init()) {
- d_printf("ERROR: Unable to open secrets database\n");
- exit(1);
- }
-
- opt_password = secrets_fetch_machine_password(lp_workgroup(), NULL, NULL);
-
- if (!opt_password) {
- d_printf("ERROR: Unable to fetch machine password\n");
- exit(1);
- }
- if (asprintf(&pwd, "%s$", global_myname()) < 0) {
- exit(ENOMEM);
- }
- set_cmdline_auth_info_username(pwd);
- set_cmdline_auth_info_password(opt_password);
- SAFE_FREE(pwd);
- SAFE_FREE(opt_password);
-
- /* machine accounts only work with kerberos */
- set_cmdline_auth_info_use_krb5_ticket();
- }
+ set_cmdline_auth_info_use_machine_account();
break;
case 'N':
set_cmdline_auth_info_password("");