aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-01-09 08:55:48 +0100
committerStefan Metzmacher <metze@samba.org>2018-03-20 17:12:12 +0100
commitbb14cec6160bf9249fe2eb997ff48ad1408885d3 (patch)
treebdb83f4f3628c7ec8399630e9829793e7ddb21c5
parentd71e1a2bf4b28442022002bf0a27ba5b0b8dbe45 (diff)
downloadsamba-bb14cec6160bf9249fe2eb997ff48ad1408885d3.tar.gz
samba-bb14cec6160bf9249fe2eb997ff48ad1408885d3.tar.xz
samba-bb14cec6160bf9249fe2eb997ff48ad1408885d3.zip
s3:libsmb: allow -U"\\administrator" to work
cli_credentials_get_principal() returns NULL in that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13206 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 0786a65cabb92a812cf1c692d0d26914f74a6f87)
-rw-r--r--source3/libsmb/cliconnect.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 75bcae42f12..b18e91278c6 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -283,8 +283,9 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli,
auth_requested = cli_credentials_authentication_requested(creds);
if (auth_requested) {
+ errno = 0;
user_principal = cli_credentials_get_principal(creds, frame);
- if (user_principal == NULL) {
+ if (errno != 0) {
TALLOC_FREE(frame);
return NT_STATUS_NO_MEMORY;
}
@@ -299,6 +300,10 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli,
try_kerberos = true;
}
+ if (user_principal == NULL) {
+ try_kerberos = false;
+ }
+
if (target_hostname == NULL) {
try_kerberos = false;
} else if (is_ipaddress(target_hostname)) {