(krb5_get_forwarded_creds): handle ports giving for the remote address
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10869 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -257,17 +257,34 @@ krb5_get_forwarded_creds (krb5_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (auth_context->remote_address) {
|
if (auth_context->remote_address) {
|
||||||
ALLOC(enc_krb_cred_part.r_address, 1);
|
if (auth_context->remote_port) {
|
||||||
if (enc_krb_cred_part.r_address == NULL) {
|
krb5_boolean noaddr;
|
||||||
ret = ENOMEM;
|
const krb5_realm *realm;
|
||||||
krb5_set_error_string(context, "malloc: out of memory");
|
|
||||||
goto out4;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = krb5_copy_address (context, auth_context->remote_address,
|
realm = krb5_princ_realm(context, out_creds->server);
|
||||||
enc_krb_cred_part.r_address);
|
krb5_appdefault_boolean(context, NULL, *realm, "no-addresses",
|
||||||
if (ret)
|
FALSE, &noaddr);
|
||||||
goto out4;
|
if (!noaddr) {
|
||||||
|
ret = krb5_make_addrport (context,
|
||||||
|
&enc_krb_cred_part.r_address,
|
||||||
|
auth_context->remote_address,
|
||||||
|
auth_context->remote_port);
|
||||||
|
if (ret)
|
||||||
|
goto out4;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ALLOC(enc_krb_cred_part.r_address, 1);
|
||||||
|
if (enc_krb_cred_part.r_address == NULL) {
|
||||||
|
ret = ENOMEM;
|
||||||
|
krb5_set_error_string(context, "malloc: out of memory");
|
||||||
|
goto out4;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = krb5_copy_address (context, auth_context->remote_address,
|
||||||
|
enc_krb_cred_part.r_address);
|
||||||
|
if (ret)
|
||||||
|
goto out4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill ticket_info.val[0] */
|
/* fill ticket_info.val[0] */
|
||||||
|
Reference in New Issue
Block a user