print the principal we're trying to use

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9215 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2000-11-23 02:31:55 +00:00
parent 27e6198fd6
commit dc92e4f3b1
2 changed files with 38 additions and 6 deletions

View File

@@ -170,7 +170,6 @@ kerberos4_send(char *name, Authenticator *ap)
CREDENTIALS cred;
int r;
printf("[ Trying %s ... ]\r\n", name);
if (!UserNameRequested) {
if (auth_debug_mode) {
printf("Kerberos V4: no user name supplied\r\n");
@@ -190,6 +189,8 @@ kerberos4_send(char *name, Authenticator *ap)
printf("Kerberos V4: no realm for %s\r\n", RemoteHostName);
return(0);
}
printf("[ Trying %s (%s.%s@%s) ... ]\r\n", name,
KRB_SERVICE_NAME, instance, realm);
r = krb_mk_req(&auth, KRB_SERVICE_NAME, instance, realm, 0L);
if (r) {
printf("mk_req failed: %s\r\n", krb_get_err_text(r));

View File

@@ -169,6 +169,7 @@ kerberos5_init(Authenticator *ap, int server)
return(1);
}
extern int net;
static int
kerberos5_send(char *name, Authenticator *ap)
{
@@ -177,9 +178,7 @@ kerberos5_send(char *name, Authenticator *ap)
int ap_opts;
krb5_data cksum_data;
char foo[2];
extern int net;
printf("[ Trying %s ... ]\r\n", name);
if (!UserNameRequested) {
if (auth_debug_mode) {
printf("Kerberos V5: no user name supplied\r\n");
@@ -229,10 +228,42 @@ kerberos5_send(char *name, Authenticator *ap)
cksum_data.length = sizeof(foo);
cksum_data.data = foo;
ret = krb5_mk_req(context, &auth_context, ap_opts,
"host", RemoteHostName,
&cksum_data, ccache, &auth);
{
krb5_principal service;
char sname[128];
ret = krb5_sname_to_principal (context,
RemoteHostName,
NULL,
KRB5_NT_SRV_HST,
&service);
if(ret) {
if (auth_debug_mode) {
printf ("Kerberos V5:"
" krb5_sname_to_principal(%s) failed (%s)\r\n",
RemoteHostName, krb5_get_err_text(context, ret));
}
return 0;
}
ret = krb5_unparse_name_fixed(context, service, sname, sizeof(sname));
if(ret) {
if (auth_debug_mode) {
printf ("Kerberos V5:"
" krb5_unparse_name_fixed failed (%s)\r\n",
krb5_get_err_text(context, ret));
}
return 0;
}
printf("[ Trying %s (%s)... ]\r\n", name, sname);
ret = krb5_mk_req_exact(context, &auth_context, ap_opts,
service,
&cksum_data, ccache, &auth);
krb5_free_principal (context, service);
}
if (ret) {
if (1 || auth_debug_mode) {
printf("Kerberos V5: mk_req failed (%s)\r\n",