]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Rename master_kdc and iprop_master_ulogsize 1090/head
authorGreg Hudson <ghudson@mit.edu>
Sun, 12 Jul 2020 01:47:08 +0000 (21:47 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 7 Sep 2020 16:20:16 +0000 (12:20 -0400)
Use "primary_kdc" and "iprop_ulogsize" as the preferred names of the
two relations.  Fall back to the old keys if the new ones are not set.

ticket: 8921

doc/admin/conf_files/kdc_conf.rst
doc/admin/conf_files/krb5_conf.rst
src/include/k5-int.h
src/include/krb5/locate_plugin.h
src/lib/kadm5/alt_prof.c
src/lib/krb5/krb/t_krb5.conf
src/lib/krb5/os/locate_kdc.c
src/util/profile/krb5.conf
src/util/profile/profile.5

index 0ca3d86ef48edc35e8956620948bf78850cf1b37..7b1b9fcd4378a1cf333b704c2ca0a9d56c780751 100644 (file)
@@ -222,10 +222,15 @@ The following tags may be specified in a [realms] subsection:
     (Boolean value.)  Specifies whether incremental database
     propagation is enabled.  The default value is false.
 
-**iprop_master_ulogsize**
+**iprop_ulogsize**
     (Integer.)  Specifies the maximum number of log entries to be
     retained for incremental propagation.  The default value is 1000.
-    Prior to release 1.11, the maximum value was 2500.
+    Prior to release 1.11, the maximum value was 2500.  New in release
+    1.19.
+
+**iprop_master_ulogsize**
+    The name for **iprop_ulogsize** prior to release 1.19.  Its value is
+    used as a fallback if **iprop_ulogsize** is not specified.
 
 **iprop_replica_poll**
     (Delta time string.)  Specifies how often the replica KDC polls
index 9e831d4aa0f5fb36eabe6cc5425dc2ce7bbc8829..e4e2443edb537272e0cd68542252f427eb5cd6b2 100644 (file)
@@ -515,12 +515,16 @@ following tags may be specified in the realm's subsection:
     host will be tried.
 
 **master_kdc**
+    The name for **primary_kdc** prior to release 1.19.  Its value is
+    used as a fallback if **primary_kdc** is not specified.
+
+**primary_kdc**
     Identifies the primary KDC(s).  Currently, this tag is used in only
     one case: If an attempt to get credentials fails because of an
     invalid password, the client software will attempt to contact the
     primary KDC, in case the user's password has just been changed, and
     the updated database has not been propagated to the replica
-    servers yet.
+    servers yet.  New in release 1.19.
 
 **v4_instance_convert**
     This subsection allows the administrator to configure exceptions
@@ -1208,7 +1212,7 @@ Here is an example of a generic krb5.conf file::
             kdc = kerberos-1.mit.edu
             kdc = kerberos-2.mit.edu
             admin_server = kerberos.mit.edu
-            master_kdc = kerberos.mit.edu
+            primary_kdc = kerberos.mit.edu
         }
         EXAMPLE.COM = {
             kdc = kerberos.example.com
index f50cee71c385a6557ec2362090b093a5bd7e4313..b3e346991db86a8d601ab85f81939693a8808e50 100644 (file)
@@ -228,6 +228,7 @@ typedef unsigned char   u_char;
 #define KRB5_CONF_IPROP_RESYNC_TIMEOUT         "iprop_resync_timeout"
 #define KRB5_CONF_IPROP_REPLICA_POLL           "iprop_replica_poll"
 #define KRB5_CONF_IPROP_SLAVE_POLL             "iprop_slave_poll"
+#define KRB5_CONF_IPROP_ULOGSIZE               "iprop_ulogsize"
 #define KRB5_CONF_K5LOGIN_AUTHORITATIVE        "k5login_authoritative"
 #define KRB5_CONF_K5LOGIN_DIRECTORY            "k5login_directory"
 #define KRB5_CONF_KADMIND_LISTEN               "kadmind_listen"
@@ -280,6 +281,7 @@ typedef unsigned char   u_char;
 #define KRB5_CONF_PLUGINS                      "plugins"
 #define KRB5_CONF_PLUGIN_BASE_DIR              "plugin_base_dir"
 #define KRB5_CONF_PREFERRED_PREAUTH_TYPES      "preferred_preauth_types"
+#define KRB5_CONF_PRIMARY_KDC                  "primary_kdc"
 #define KRB5_CONF_PROXIABLE                    "proxiable"
 #define KRB5_CONF_QUALIFY_SHORTNAME            "qualify_shortname"
 #define KRB5_CONF_RDNS                         "rdns"
index d0e85494d7e16851bd02e6379ffe68a197284418..7a872a159cc103ced8023308d36cc62de45f6034 100644 (file)
 
 enum locate_service_type {
     locate_service_kdc = 1,
-    locate_service_master_kdc,
+    locate_service_primary_kdc,
     locate_service_kadmin,
     locate_service_krb524,
     locate_service_kpasswd
 };
+#define locate_service_master_kdc locate_service_primary_kdc
 
 typedef struct krb5plugin_service_locate_ftable {
     int minor_version;          /* currently 0 */
index 5531a10fb431c040d89d673a8d02e2beb5ad4236..d166f0aba61fd26f706b1778e5cadca018e3f139 100644 (file)
@@ -784,24 +784,25 @@ krb5_error_code kadm5_get_config_params(krb5_context context,
     GET_DELTAT_PARAM(iprop_resync_timeout, KADM5_CONFIG_IPROP_RESYNC_TIMEOUT,
                      KRB5_CONF_IPROP_RESYNC_TIMEOUT, 60 * 5);
 
-    hierarchy[2] = KRB5_CONF_IPROP_MASTER_ULOGSIZE;
-
-    params.iprop_ulogsize = DEF_ULOGENTRIES;
-    params.mask |= KADM5_CONFIG_ULOG_SIZE;
-
     if (params_in->mask & KADM5_CONFIG_ULOG_SIZE) {
         params.mask |= KADM5_CONFIG_ULOG_SIZE;
         params.iprop_ulogsize = params_in->iprop_ulogsize;
     } else {
+        params.iprop_ulogsize = 0;
+        hierarchy[2] = KRB5_CONF_IPROP_ULOGSIZE;
         if (aprofile != NULL &&
-            !krb5_aprof_get_int32(aprofile, hierarchy, TRUE, &ivalue)) {
-            if (ivalue <= 0)
-                params.iprop_ulogsize = DEF_ULOGENTRIES;
-            else
-                params.iprop_ulogsize = ivalue;
-            params.mask |= KADM5_CONFIG_ULOG_SIZE;
-        }
+            !krb5_aprof_get_int32(aprofile, hierarchy, TRUE, &ivalue) &&
+            ivalue > 0)
+            params.iprop_ulogsize = ivalue;
+        hierarchy[2] = KRB5_CONF_IPROP_MASTER_ULOGSIZE;
+        if (params.iprop_ulogsize == 0 && aprofile != NULL &&
+            !krb5_aprof_get_int32(aprofile, hierarchy, TRUE, &ivalue) &&
+            ivalue > 0)
+            params.iprop_ulogsize = ivalue;
+        if (params.iprop_ulogsize == 0)
+            params.iprop_ulogsize = DEF_ULOGENTRIES;
     }
+    params.mask |= KADM5_CONFIG_ULOG_SIZE;
 
     GET_DELTAT_PARAM(iprop_poll_time, KADM5_CONFIG_POLL_TIME,
                      KRB5_CONF_IPROP_REPLICA_POLL, -1);
index a80b4ce2afa2f52072fe5d59c82b299158db1ea9..a851fbd38dfd1a11518470523a27ca2c530e22da 100644 (file)
@@ -7,7 +7,7 @@
                kdc = KERBEROS-2.MIT.EDU:88
                kdc = KERBEROS.MIT.EDU
                kdc = KERBEROS-1.MIT.EDU
-               master_kdc = KERBEROS.MIT.EDU
+               primary_kdc = KERBEROS.MIT.EDU
                admin_server = KERBEROS.MIT.EDU
                default_domain = MIT.EDU
                v4_instance_convert = {
index 7036c748cd85036227527670a75c6d8263627717..edca5ac7eb438e30cd5cd20c950b656d6b2c7bac 100644 (file)
@@ -246,6 +246,11 @@ locate_srv_conf_1(krb5_context context, const krb5_data *realm,
     realm_srv_names[2] = name;
     realm_srv_names[3] = 0;
     code = profile_get_values(context->profile, realm_srv_names, &hostlist);
+    if (code == PROF_NO_RELATION && strcmp(name, KRB5_CONF_PRIMARY_KDC) == 0) {
+        realm_srv_names[2] = KRB5_CONF_MASTER_KDC;
+        code = profile_get_values(context->profile, realm_srv_names,
+                                  &hostlist);
+    }
     if (code) {
         Tprintf("config file lookup failed: %s\n", error_message(code));
         if (code == PROF_NO_SECTION || code == PROF_NO_RELATION)
@@ -495,8 +500,8 @@ prof_locate_server(krb5_context context, const krb5_data *realm,
     kdc_ports:
         dflport = KRB5_DEFAULT_PORT;
         break;
-    case locate_service_master_kdc:
-        profname = KRB5_CONF_MASTER_KDC;
+    case locate_service_primary_kdc:
+        profname = KRB5_CONF_PRIMARY_KDC;
         goto kdc_ports;
     case locate_service_kadmin:
         profname = KRB5_CONF_ADMIN_SERVER;
@@ -663,7 +668,7 @@ dns_locate_server_uri(krb5_context context, const krb5_data *realm,
         return 0;
 
     switch (svc) {
-    case locate_service_master_kdc:
+    case locate_service_primary_kdc:
         find_primary = TRUE;
         /* Fall through */
     case locate_service_kdc:
@@ -707,7 +712,7 @@ dns_locate_server_srv(krb5_context context, const krb5_data *realm,
     case locate_service_kdc:
         dnsname = "_kerberos";
         break;
-    case locate_service_master_kdc:
+    case locate_service_primary_kdc:
         dnsname = "_kerberos-master";
         break;
     case locate_service_kadmin:
@@ -824,7 +829,7 @@ k5_locate_kdc(krb5_context context, const krb5_data *realm,
 {
     enum locate_service_type stype;
 
-    stype = get_primaries ? locate_service_master_kdc : locate_service_kdc;
+    stype = get_primaries ? locate_service_primary_kdc : locate_service_kdc;
     return k5_locate_server(context, realm, serverlist, stype, no_udp);
 }
 
@@ -838,7 +843,7 @@ k5_kdc_is_primary(krb5_context context, const krb5_data *realm,
     if (server->primary != -1)
         return server->primary;
 
-    if (locate_server(context, realm, &list, locate_service_master_kdc,
+    if (locate_server(context, realm, &list, locate_service_primary_kdc,
                       server->transport) != 0)
         return FALSE;
     found = server_list_contains(&list, server);
index 7d38e9e532adeb93ba4344428a793fa6a4462622..de4de846a8be84bd71d94392be2139fec7c46505 100644 (file)
@@ -10,7 +10,7 @@
                kdc = kerberos-1.mit.edu
                kdc = kerberos-2.mit.edu
                kdc = kerberos-3.mit.edu
-               master_kdc = kerberos.mit.edu
+               primary_kdc = kerberos.mit.edu
                admin_server = kerberos.mit.edu
        } 
        MEDIA-LAB.MIT.EDU = {
index 1b0748e6112a57ee74f9e4ce858c6e364cb6c682..3da65570580de85fa29feaa2377b2b69359cbb03 100644 (file)
@@ -27,7 +27,7 @@ An example profile file might look like this:
                kdc = kerberos.mit.edu
                kdc = kerberos-1.mit.edu
                kdc = kerberos-2.mit.edu
-               master_kdc = kerberos.mit.edu
+               primary_kdc = kerberos.mit.edu
                admin_server = kerberos.mit.edu
        }
        CYGNUS.COM = {
@@ -66,7 +66,7 @@ sections have been marked as final:
 [realms]
        ATHENA.MIT.EDU = {
                kdc = kerberos.mit.edu
-               master_kdc = kerberos.mit.edu
+               primary_kdc = kerberos.mit.edu
                admin_server = kerberos.mit.edu
        }*