}
}
#endif
- set_string(c->pname, ANAME_SZ, krb5_princ_component(creds.client, 1));
- set_string(c->pinst, INST_SZ, krb5_princ_component(creds.client, 2));
-
+ set_string(c->pname, ANAME_SZ, krb5_princ_component(creds.client, 0));
+ if (creds.client->length > 1) {
+ set_string(c->pinst, INST_SZ, krb5_princ_component(creds.client, 1));
+ }
+ else {
+ c->pinst[0] = '\0';
+ }
set_string(c->realm, REALM_SZ, krb5_princ_realm(creds.server));
- set_string(c->service, REALM_SZ, krb5_princ_component(creds.server, 1));
- set_string(c->instance, REALM_SZ, krb5_princ_component(creds.server, 2));
+ set_string(c->service, ANAME_SZ, krb5_princ_component(creds.server, 0));
+* set_string(c->instance, INST_SZ, krb5_princ_component(creds.server, 1));
c->ticket_st.length = creds.ticket.length;
memcpy((char *)c->ticket_st.dat,
#endif /* !lint & !SABER */
#include "krb425.h"
+#include <sys/param.h>
static krb5_error_code
setkey_key_proc(DECLARG(krb5_pointer,arg),
krb5_data authe;
extern int gethostname();
int use_set_key = 0;
+ char file_name[MAXPATHLEN];
+ int tmp;
if (from_addr) {
peer.addrtype = ADDRTYPE_INET;
if (!fn) {
use_set_key = 1;
fn = (char *)0;
- } else if (!*fn)
+ } else if (!*fn) {
fn = (char *)0;
+ } else {
+ strcpy(file_name, "FILE:");
+ strncpy(file_name + 5, fn, MAXPATHLEN-5);
+ file_name[sizeof(file_name)-1] = '\0';
+ fn = file_name;
+ }
+
#ifdef EBUG
EPRINT "Calling krb5_rd_req with:\n");
r = 0;
#endif
set_string(ad->pname, ANAME_SZ,
- krb5_princ_component(authdat->authenticator->client, 1));
- set_string(ad->pinst, INST_SZ,
- krb5_princ_component(authdat->authenticator->client, 2));
- set_string(ad->prealm, REALM_SZ,
krb5_princ_component(authdat->authenticator->client, 0));
+ if (authdat->authenticator->client->length > 1) {
+ set_string(ad->pinst, INST_SZ,
+ krb5_princ_component(authdat->authenticator->client,
+ 1));
+ }
+ else {
+ ad->pinst[0] = '\0';
+ }
+
+ set_string(ad->prealm, REALM_SZ,
+ krb5_princ_realm(authdat->authenticator->client));
+
ad->checksum = *(long *)authdat->authenticator->checksum->contents;
if (authdat->ticket->enc_part2->session->keytype != KEYTYPE_DES) {