diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/cmdline/popt_common.c | 11 | ||||
-rw-r--r-- | source4/lib/credentials.c | 10 |
2 files changed, 7 insertions, 14 deletions
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c index fe76292acb..43ea203b78 100644 --- a/source4/lib/cmdline/popt_common.c +++ b/source4/lib/cmdline/popt_common.c @@ -241,17 +241,7 @@ static void popt_common_credentials_callback(poptContext con, cli_credentials_set_machine_account_pending(cmdline_credentials); /* machine accounts only work with kerberos (fall though)*/ - - case 'k': -#ifndef HAVE_KRB5 - d_printf("No kerberos support compiled in\n"); - exit(1); -#else - lp_set_cmdline("gensec:krb5", "True"); -#endif break; - - } } @@ -261,7 +251,6 @@ struct poptOption popt_common_credentials[] = { { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, popt_common_credentials_callback }, { "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "[DOMAIN\\]USERNAME[%PASSWORD]" }, { "no-pass", 'N', POPT_ARG_NONE, &dont_ask, True, "Don't ask for a password" }, - { "kerberos", 'k', POPT_ARG_NONE, NULL, 'k', "Use kerberos (active directory) authentication" }, { "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A', "Get the credentials from a file", "FILE" }, { "signing", 'S', POPT_ARG_STRING, NULL, 'S', "Set the client signing state", "on|off|required" }, { "machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', "Use stored machine account password (implies -k)" }, diff --git a/source4/lib/credentials.c b/source4/lib/credentials.c index cdef9042b8..4650fee1af 100644 --- a/source4/lib/credentials.c +++ b/source4/lib/credentials.c @@ -121,9 +121,13 @@ const char *cli_credentials_get_principal(struct cli_credentials *cred, TALLOC_C } if (cred->principal_obtained < cred->username_obtained) { - return talloc_asprintf(mem_ctx, "%s@%s", - cli_credentials_get_username(cred, mem_ctx), - cli_credentials_get_realm(cred)); + if (cred->domain_obtained > cred->realm_obtained) { + return NULL; + } else { + return talloc_asprintf(mem_ctx, "%s@%s", + cli_credentials_get_username(cred, mem_ctx), + cli_credentials_get_realm(cred)); + } } return talloc_reference(mem_ctx, cred->principal); } |