(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).  | ||||
|  * All rights reserved.  | ||||
|  * | ||||
| @@ -257,17 +257,34 @@ krb5_get_forwarded_creds (krb5_context	    context, | ||||
|     } | ||||
|  | ||||
|     if (auth_context->remote_address) { | ||||
| 	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; | ||||
| 	} | ||||
| 	if (auth_context->remote_port) { | ||||
| 	    krb5_boolean noaddr; | ||||
| 	    const krb5_realm *realm; | ||||
|  | ||||
| 	ret = krb5_copy_address (context, auth_context->remote_address, | ||||
| 				 enc_krb_cred_part.r_address); | ||||
| 	if (ret) | ||||
| 	    goto out4; | ||||
| 	    realm = krb5_princ_realm(context, out_creds->server); | ||||
| 	    krb5_appdefault_boolean(context, NULL, *realm, "no-addresses", | ||||
| 				    FALSE, &noaddr); | ||||
| 	    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] */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund