#endif
#ifdef KRB5
- code = krb5_parse_name(k5_context, name, &principal);
- code = krb5_cc_initialize(k5_context, k5_ccache, principal);
- memset(&creds, 0, sizeof(creds));
- creds.client = principal;
-
- code = krb5_build_principal_ext(k5_context, &server,
- krb5_princ_realm(k5_context, principal)->length,
- krb5_princ_realm(k5_context, principal)->data,
- KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME,
- krb5_princ_realm(k5_context, principal)->length,
- krb5_princ_realm(k5_context, principal)->data, 0);
-
- creds.server = server;
-
- //code = krb5_os_localaddr(&address);
- code = krb5_timeofday(k5_context, &now);
-
- creds.times.starttime = 0;
- creds.times.endtime = now + 60L * lifetime;
- creds.times.renew_till = 0;
-
- code = krb5_get_in_tkt_with_password(k5_context, 0, NULL, NULL,
- NULL, password, k5_ccache, &creds, 0);
-
- krb5_free_principal(k5_context, server);
- //krb5_free_addresses(k5_context, address);
+ do {
+ principal = server = NULL;
+ memset(&creds, 0, sizeof(creds));
+
+ code = krb5_parse_name(k5_context, name, &principal);
+ if (code) break;
+ code = krb5_cc_initialize(k5_context, k5_ccache, principal);
+ if (code) break;
+
+ code = krb5_build_principal_ext(k5_context, &server,
+ krb5_princ_realm(k5_context, principal)->length,
+ krb5_princ_realm(k5_context, principal)->data,
+ KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME,
+ krb5_princ_realm(k5_context, principal)->length,
+ krb5_princ_realm(k5_context, principal)->data, 0);
+ if (code) break;
+
+ creds.client = principal;
+ creds.server = server;
+
+ code = krb5_timeofday(k5_context, &now);
+ if (code) break;
+ creds.times.starttime = 0;
+ creds.times.endtime = now + 60L * lifetime;
+ creds.times.renew_till = 0;
+
+ code = krb5_get_in_tkt_with_password(k5_context, 0, NULL,
+ NULL, NULL, password, k5_ccache, &creds, 0);
+ } while (0);
+
+ if (principal)
+ krb5_free_principal(k5_context, principal);
+ if (server)
+ krb5_free_principal(k5_context, server);
#endif
com_err (NULL, code, "while logging in");
return TRUE;
}
- // ticket_init_list(GetDlgItem(hwnd, IDD_TICKET_LIST));
-
#endif
SetDlgItemText(hwnd, IDD_LOGIN_PASSWORD, "");
#ifdef KRB5
code = k5_dest_tkt ();
- // ticket_init_list(GetDlgItem(hwnd, IDD_TICKET_LIST));
#endif
kwin_set_default_focus(hwnd);
if (isblocking)
return TRUE;
- strcpy(copyright, " Kerberos for Windows\n");
+ #ifdef KRB4
+ strcpy(copyright, " Kerberos 4 for Windows\n");
+ #endif
+ #ifdef KRB5
+ strcpy(copyright, " Kerberos 5 for Windows\n");
+ #endif
strcat(copyright, "\n Version 1.00\n\n");
strcat(copyright, " For support, contact:\n");
strcat(copyright, ORGANIZATION);