(krb5_get_default_realm): let krb5_set_default_realm set an error
string for us git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13404 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 - 2001, 2004 Kungliga Tekniska H<>gskolan | ||||||
|  * (Royal Institute of Technology, Stockholm, Sweden).  |  * (Royal Institute of Technology, Stockholm, Sweden).  | ||||||
|  * All rights reserved.  |  * All rights reserved.  | ||||||
|  * |  * | ||||||
| @@ -63,15 +63,15 @@ krb5_error_code | |||||||
| krb5_get_default_realm(krb5_context context, | krb5_get_default_realm(krb5_context context, | ||||||
| 		       krb5_realm *realm) | 		       krb5_realm *realm) | ||||||
| { | { | ||||||
|  |     krb5_error_code ret; | ||||||
|     char *res; |     char *res; | ||||||
|  |  | ||||||
|     if (context->default_realms == NULL |     if (context->default_realms == NULL | ||||||
| 	|| context->default_realms[0] == NULL) { | 	|| context->default_realms[0] == NULL) { | ||||||
| 	krb5_error_code ret = krb5_set_default_realm (context, NULL); | 	krb5_clear_error_string(context); | ||||||
| 	if (ret) { | 	ret = krb5_set_default_realm (context, NULL); | ||||||
| 	    krb5_set_error_string(context, "no default realm configured"); | 	if (ret) | ||||||
| 	    return KRB5_CONFIG_NODEFREALM; | 	    return ret; | ||||||
| 	} |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     res = strdup (context->default_realms[0]); |     res = strdup (context->default_realms[0]); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Johan Danielsson
					Johan Danielsson