config file update
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1976 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -180,7 +180,7 @@ typedef struct krb5_cc_ops{ | ||||
| typedef struct krb5_context_data{ | ||||
|     krb5_enctype *etypes; | ||||
|     char *default_realm; | ||||
|     k5_cfile *cf; | ||||
|     krb5_config_section *cf; | ||||
|     struct error_list *et_list; | ||||
|     krb5_cc_ops *cc_ops; | ||||
|     int num_ops; | ||||
|   | ||||
| @@ -7,22 +7,28 @@ krb5_get_krbhst (krb5_context context, | ||||
| 		 const krb5_realm *realm, | ||||
| 		 char ***hostlist) | ||||
| { | ||||
|      krb5_error_code err; | ||||
|      char buf[BUFSIZ]; | ||||
|      char *r; | ||||
|      char *val; | ||||
|  | ||||
|      memset(buf, 0, sizeof(buf)); | ||||
|      strcpy(buf, "realms "); | ||||
| #ifdef USE_ASN1_PRINCIPAL | ||||
|      strcat(buf, *realm); | ||||
|      r = *realm; | ||||
| #else | ||||
|      strncat(buf, (char*)realm->data, realm->length); | ||||
|      r = malloc (realm->length + 1); | ||||
|      strncpy (r, realm->data, realm->length); | ||||
|      r[realm->length] = '\0'; | ||||
| #endif | ||||
|      strcat(buf, " kdc"); | ||||
|  | ||||
|      err = krb5_get_config_tag (context->cf, buf, &val); | ||||
|      if (err) | ||||
| 	  return err; | ||||
|      val = krb5_config_get_string (context->cf, | ||||
| 				   "realms", | ||||
| 				   r, | ||||
| 				   "kdc", | ||||
| 				   NULL); | ||||
| #ifndef USE_ASN1_PRINCIPAL | ||||
|      free (r); | ||||
| #endif | ||||
|      if (val == NULL) | ||||
| 	 return KRB5_REALM_UNKNOWN; | ||||
|  | ||||
|      *hostlist = malloc (2 * sizeof (char *)); | ||||
|      (*hostlist)[0] = val; | ||||
|      (*hostlist)[1] = NULL; | ||||
| @@ -33,9 +39,6 @@ krb5_error_code | ||||
| krb5_free_krbhst (krb5_context context, | ||||
| 		  char *const *hostlist) | ||||
| { | ||||
|     char *const*p; | ||||
|     for(p = hostlist; *p; p++) | ||||
| 	free(*p); | ||||
|     free ((void*)hostlist); | ||||
|     return 0; /* XXX */ | ||||
|     free ((void *)hostlist); | ||||
|     return 0; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund