diff options
Diffstat (limited to 'source3/lib/popt_common.c')
-rw-r--r-- | source3/lib/popt_common.c | 30 |
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(""); |