+2003-01-08 Sam Hartman <hartmans@mit.edu>
+
+ * fwd_tgt.c (krb5_fwd_tgt_creds): Don't require hostname to be supplied unless you are using addresses in the ticket.
+
2003-01-07 Ken Raeburn <raeburn@mit.edu>
* appdefault.c (conf_yes, conf_no): Now const.
memset((char *)&creds, 0, sizeof(creds));
memset((char *)&tgt, 0, sizeof(creds));
- if (rhost == NULL) {
- if (krb5_princ_type(context, server) != KRB5_NT_SRV_HST)
- return(KRB5_FWD_BAD_PRINCIPAL);
-
- if (krb5_princ_size(context, server) < 2)
- return (KRB5_CC_BADNAME);
-
- rhost = malloc(server->data[1].length+1);
- if (!rhost)
- return ENOMEM;
- free_rhost = 1;
- memcpy(rhost, server->data[1].data, server->data[1].length);
- rhost[server->data[1].length] = '\0';
- }
if (cc == 0) {
if ((retval = krb5int_cc_default(context, &cc)))
goto errout;
}
if (tgt.addresses && *tgt.addresses) {
+ if (rhost == NULL) {
+ if (krb5_princ_type(context, server) != KRB5_NT_SRV_HST) {
+retval = KRB5_FWD_BAD_PRINCIPAL;
+ goto errout;
+ }
+
+ if (krb5_princ_size(context, server) < 2){
+ retval = KRB5_CC_BADNAME;
+ goto errout;
+ }
+
+ rhost = malloc(server->data[1].length+1);
+ if (!rhost) {
+ retval = ENOMEM;
+ goto errout;
+ }
+ free_rhost = 1;
+ memcpy(rhost, server->data[1].data, server->data[1].length);
+ rhost[server->data[1].length] = '\0';
+ }
+
retval = krb5_os_hostaddr(context, rhost, &addrs);
if (retval)
goto errout;