svn rev #21839: branches/mkey_migrate/src/ include/ kdc/ lib/kadm5/ lib/kadm5/srv/
raeburn@MIT.EDU
raeburn at MIT.EDU
Fri Jan 30 16:12:32 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21839
Commit By: raeburn
Log Message:
merge to trunk r21838; no conflicts; tested on mac, and partially tested on linux
Changed Files:
U branches/mkey_migrate/src/include/adm_proto.h
U branches/mkey_migrate/src/kdc/do_tgs_req.c
U branches/mkey_migrate/src/kdc/main.c
U branches/mkey_migrate/src/lib/kadm5/alt_prof.c
U branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports
Modified: branches/mkey_migrate/src/include/adm_proto.h
===================================================================
--- branches/mkey_migrate/src/include/adm_proto.h 2009-01-30 20:40:46 UTC (rev 21838)
+++ branches/mkey_migrate/src/include/adm_proto.h 2009-01-30 21:12:30 UTC (rev 21839)
@@ -97,7 +97,7 @@
krb5_realm_params **);
krb5_error_code krb5_free_realm_params (krb5_context,
krb5_realm_params *);
-krb5_boolean match_config_pattern(const char *, const char *);
+krb5_boolean krb5_match_config_pattern(const char *, const char *);
/* str_conv.c */
krb5_error_code
Modified: branches/mkey_migrate/src/kdc/do_tgs_req.c
===================================================================
--- branches/mkey_migrate/src/kdc/do_tgs_req.c 2009-01-30 20:40:46 UTC (rev 21838)
+++ branches/mkey_migrate/src/kdc/do_tgs_req.c 2009-01-30 21:12:30 UTC (rev 21839)
@@ -1104,11 +1104,11 @@
if ((krb5_princ_type(kdc_context, request->server) == KRB5_NT_SRV_HST ||
(krb5_princ_type(kdc_context, request->server) == KRB5_NT_UNKNOWN &&
kdc_active_realm->realm_host_based_services != NULL &&
- (match_config_pattern(kdc_active_realm->realm_host_based_services, comp1_str) == TRUE ||
- match_config_pattern(kdc_active_realm->realm_host_based_services, "*") == TRUE))) &&
+ (krb5_match_config_pattern(kdc_active_realm->realm_host_based_services, comp1_str) == TRUE ||
+ krb5_match_config_pattern(kdc_active_realm->realm_host_based_services, "*") == TRUE))) &&
(kdc_active_realm->realm_no_host_referral == NULL ||
- (match_config_pattern(kdc_active_realm->realm_no_host_referral, "*") == FALSE &&
- match_config_pattern(kdc_active_realm->realm_no_host_referral, comp1_str) == FALSE))) {
+ (krb5_match_config_pattern(kdc_active_realm->realm_no_host_referral, "*") == FALSE &&
+ krb5_match_config_pattern(kdc_active_realm->realm_no_host_referral, comp1_str) == FALSE))) {
for (len=0; len < comp2->length; len++) {
if (comp2->data[len] == '.') break;
Modified: branches/mkey_migrate/src/kdc/main.c
===================================================================
--- branches/mkey_migrate/src/kdc/main.c 2009-01-30 20:40:46 UTC (rev 21838)
+++ branches/mkey_migrate/src/kdc/main.c 2009-01-30 21:12:30 UTC (rev 21839)
@@ -176,13 +176,17 @@
{
krb5_error_code retval = 0;
- if (no_refrls && match_config_pattern(no_refrls, "*") == TRUE)
+ if (no_refrls && krb5_match_config_pattern(no_refrls, "*") == TRUE) {
rdp->realm_no_host_referral = strdup("*");
- else {
+ if (!rdp->realm_no_host_referral)
+ retval = ENOMEM;
+ } else {
if (rparams && rparams->realm_no_host_referral) {
- if (match_config_pattern(rparams->realm_no_host_referral, "*") == TRUE)
+ if (krb5_match_config_pattern(rparams->realm_no_host_referral, "*") == TRUE) {
rdp->realm_no_host_referral = strdup("*");
- else if (no_refrls && (asprintf(&(rdp->realm_no_host_referral), "%s%s%s%s%s",
+ if (!rdp->realm_no_host_referral)
+ retval = ENOMEM;
+ } else if (no_refrls && (asprintf(&(rdp->realm_no_host_referral), "%s%s%s%s%s",
" ", no_refrls," ",rparams->realm_no_host_referral, " ") < 0))
retval = ENOMEM;
else if (asprintf(&(rdp->realm_no_host_referral),"%s%s%s", " ",
@@ -194,18 +198,22 @@
rdp->realm_no_host_referral = NULL;
}
- if (rdp->realm_no_host_referral && match_config_pattern(rdp->realm_no_host_referral, "*") == TRUE) {
+ if (rdp->realm_no_host_referral && krb5_match_config_pattern(rdp->realm_no_host_referral, "*") == TRUE) {
rdp->realm_host_based_services = NULL;
return 0;
}
- if (host_based_srvcs && (match_config_pattern(host_based_srvcs, "*") == TRUE))
+ if (host_based_srvcs && (krb5_match_config_pattern(host_based_srvcs, "*") == TRUE)) {
rdp->realm_host_based_services = strdup("*");
- else {
+ if (!rdp->realm_host_based_services)
+ retval = ENOMEM;
+ } else {
if (rparams && rparams->realm_host_based_services) {
- if (match_config_pattern(rparams->realm_host_based_services, "*") == TRUE)
+ if (krb5_match_config_pattern(rparams->realm_host_based_services, "*") == TRUE) {
rdp->realm_host_based_services = strdup("*");
- else if (host_based_srvcs && asprintf(&(rdp->realm_host_based_services), "%s%s%s%s%s",
+ if (!rdp->realm_host_based_services)
+ retval = ENOMEM;
+ } else if (host_based_srvcs && asprintf(&(rdp->realm_host_based_services), "%s%s%s%s%s",
" ", host_based_srvcs," ",rparams->realm_host_based_services, " ") < 0)
retval = ENOMEM;
else if (asprintf(&(rdp->realm_host_based_services),"%s%s%s", " ",
@@ -261,8 +269,13 @@
}
/* Handle profile file name */
- if (rparams && rparams->realm_profile)
+ if (rparams && rparams->realm_profile) {
rdp->realm_profile = strdup(rparams->realm_profile);
+ if (!rdp->realm_profile) {
+ kret = ENOMEM;
+ goto whoops;
+ }
+ }
/* Handle master key name */
if (rparams && rparams->realm_mkey_name)
@@ -270,20 +283,35 @@
else
rdp->realm_mpname = (def_mpname) ? strdup(def_mpname) :
strdup(KRB5_KDB_M_NAME);
+ if (!rdp->realm_mpname) {
+ kret = ENOMEM;
+ goto whoops;
+ }
/* Handle KDC ports */
if (rparams && rparams->realm_kdc_ports)
rdp->realm_ports = strdup(rparams->realm_kdc_ports);
else
rdp->realm_ports = strdup(def_udp_ports);
+ if (!rdp->realm_ports) {
+ kret = ENOMEM;
+ goto whoops;
+ }
if (rparams && rparams->realm_kdc_tcp_ports)
rdp->realm_tcp_ports = strdup(rparams->realm_kdc_tcp_ports);
else
rdp->realm_tcp_ports = strdup(def_tcp_ports);
-
+ if (!rdp->realm_tcp_ports) {
+ kret = ENOMEM;
+ goto whoops;
+ }
/* Handle stash file */
if (rparams && rparams->realm_stash_file) {
rdp->realm_stash = strdup(rparams->realm_stash_file);
+ if (!rdp->realm_stash) {
+ kret = ENOMEM;
+ goto whoops;
+ }
manual = FALSE;
} else
manual = def_manual;
@@ -538,7 +566,7 @@
hierarchy[1] = "no_host_referral";
if (krb5_aprof_get_string_all(aprof, hierarchy, &no_refrls))
no_refrls = 0;
- if (!no_refrls || match_config_pattern(no_refrls, "*") == FALSE) {
+ if (!no_refrls || krb5_match_config_pattern(no_refrls, "*") == FALSE) {
hierarchy[1] = "host_based_services";
if (krb5_aprof_get_string_all(aprof, hierarchy, &host_based_srvcs))
host_based_srvcs = 0;
@@ -549,10 +577,22 @@
krb5_aprof_finish(aprof);
}
- if (default_udp_ports == 0)
+ if (default_udp_ports == 0) {
default_udp_ports = strdup(DEFAULT_KDC_UDP_PORTLIST);
- if (default_tcp_ports == 0)
+ if (default_udp_ports == 0) {
+ fprintf(stderr," KDC cannot initialize. Not enough memory\n");
+ exit(1);
+ }
+ }
+ if (default_tcp_ports == 0) {
default_tcp_ports = strdup(DEFAULT_KDC_TCP_PORTLIST);
+ default_tcp_ports = strdup(DEFAULT_KDC_TCP_PORTLIST);
+ if (default_tcp_ports == 0) {
+ fprintf(stderr," KDC cannot initialize. Not enough memory\n");
+ exit(1);
+ }
+ }
+
/*
* Loop through the option list. Each time we encounter a realm name,
* use the previously scanned options to fill in for defaults.
@@ -648,6 +688,10 @@
if (default_udp_ports)
free(default_udp_ports);
default_udp_ports = strdup(optarg);
+ if (!default_udp_ports) {
+ fprintf(stderr," KDC cannot initialize. Not enough memory\n");
+ exit(1);
+ }
#if 0 /* not yet */
if (default_tcp_ports)
free(default_tcp_ports);
@@ -712,6 +756,10 @@
free(db_args);
if (db_name)
free(db_name);
+ if (host_based_srvcs)
+ free(host_based_srvcs);
+ if (no_refrls)
+ free(no_refrls);
return;
}
Modified: branches/mkey_migrate/src/lib/kadm5/alt_prof.c
===================================================================
--- branches/mkey_migrate/src/lib/kadm5/alt_prof.c 2009-01-30 20:40:46 UTC (rev 21838)
+++ branches/mkey_migrate/src/lib/kadm5/alt_prof.c 2009-01-30 21:12:30 UTC (rev 21839)
@@ -39,7 +39,7 @@
#include <ctype.h>
#include <kdb_log.h>
-krb5_boolean match_config_pattern(const char *, const char*);
+krb5_boolean krb5_match_config_pattern(const char *, const char*);
static krb5_key_salt_tuple *copy_key_salt_tuple(ksalt, len)
krb5_key_salt_tuple *ksalt;
krb5_int32 len;
@@ -1035,7 +1035,7 @@
else
no_refrls = 0;
- if (!no_refrls || match_config_pattern(no_refrls, "*") == FALSE) {
+ if (!no_refrls || krb5_match_config_pattern(no_refrls, "*") == FALSE) {
hierarchy[2] = "host_based_services";
if (!krb5_aprof_get_string_all(aprofile, hierarchy, &host_based_srvcs))
rparams->realm_host_based_services = host_based_srvcs;
@@ -1124,7 +1124,7 @@
* In conf file the values are separates by commas or whitespaces.
*/
krb5_boolean
-match_config_pattern(const char *string, const char *pattern)
+krb5_match_config_pattern(const char *string, const char *pattern)
{
const char *ptr;
char next = '\0';
Modified: branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports
===================================================================
--- branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports 2009-01-30 20:40:46 UTC (rev 21838)
+++ branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports 2009-01-30 21:12:30 UTC (rev 21839)
@@ -84,7 +84,7 @@
krb5_read_realm_params
krb5_string_to_flags
krb5_string_to_keysalts
-match_config_pattern
+krb5_match_config_pattern
master_db
master_keyblock
master_keylist
More information about the cvs-krb5
mailing list