krb5 commit: Tidy up k5-int.h variable name constants

Greg Hudson ghudson at MIT.EDU
Mon Jun 16 18:40:53 EDT 2014


https://github.com/krb5/krb5/commit/d4332d0f778b55ccd5ddb05a4cd0b96354da9f39
commit d4332d0f778b55ccd5ddb05a4cd0b96354da9f39
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Jun 13 13:52:55 2014 -0400

    Tidy up k5-int.h variable name constants
    
    Fix three mismatched constant names, and properly alphabetize and
    columnize the lists of definitions.  No functional changes.

 src/include/k5-int.h                         |  197 +++++++++++++-------------
 src/kdc/main.c                               |    4 +-
 src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c |    2 +-
 3 files changed, 102 insertions(+), 101 deletions(-)

diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index 83c8759..9f14ee0 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -177,106 +177,107 @@ typedef unsigned char   u_char;
 /* Define tracing macros. */
 #include "k5-trace.h"
 
-/* cofiguration variables */
-#define KRB5_CONF_ACL_FILE                       "acl_file"
-#define KRB5_CONF_ADMIN_SERVER                   "admin_server"
-#define KRB5_CONF_ALLOW_WEAK_CRYPTO              "allow_weak_crypto"
-#define KRB5_CONF_AP_REQ_CHECKSUM_TYPE           "ap_req_checksum_type"
-#define KRB5_CONF_AUTH_TO_LOCAL                  "auth_to_local"
-#define KRB5_CONF_AUTH_TO_LOCAL_NAMES            "auth_to_local_names"
-#define KRB5_CONF_CANONICALIZE                   "canonicalize"
-#define KRB5_CONF_CCACHE_TYPE                    "ccache_type"
-#define KRB5_CONF_CLOCKSKEW                      "clockskew"
-#define KRB5_CONF_DATABASE_NAME                  "database_name"
-#define KRB5_CONF_DB_MODULE_DIR                  "db_module_dir"
-#define KRB5_CONF_DEFAULT                        "default"
-#define KRB5_CONF_DEFAULT_REALM                  "default_realm"
-#define KRB5_CONF_DEFAULT_CCACHE_NAME            "default_ccache_name"
-#define KRB5_CONF_DEFAULT_CLIENT_KEYTAB_NAME     "default_client_keytab_name"
-#define KRB5_CONF_DEFAULT_DOMAIN                 "default_domain"
-#define KRB5_CONF_DEFAULT_TKT_ENCTYPES           "default_tkt_enctypes"
-#define KRB5_CONF_DEFAULT_TGS_ENCTYPES           "default_tgs_enctypes"
-#define KRB5_CONF_DEFAULT_KEYTAB_NAME            "default_keytab_name"
-#define KRB5_CONF_DEFAULT_PRINCIPAL_EXPIRATION   "default_principal_expiration"
-#define KRB5_CONF_DEFAULT_PRINCIPAL_FLAGS        "default_principal_flags"
-#define KRB5_CONF_DICT_FILE                   "dict_file"
-#define KRB5_CONF_DISABLE                     "disable"
-#define KRB5_CONF_DISABLE_LAST_SUCCESS        "disable_last_success"
-#define KRB5_CONF_DISABLE_LOCKOUT             "disable_lockout"
-#define KRB5_CONF_DNS_CANONICALIZE_HOSTNAME   "dns_canonicalize_hostname"
-#define KRB5_CONF_DNS_LOOKUP_KDC              "dns_lookup_kdc"
-#define KRB5_CONF_DNS_LOOKUP_REALM            "dns_lookup_realm"
-#define KRB5_CONF_DNS_FALLBACK                "dns_fallback"
-#define KRB5_CONF_DOMAIN_REALM                "domain_realm"
-#define KRB5_CONF_ENABLE_ONLY                 "enable_only"
-#define KRB5_CONF_EXTRA_ADDRESSES             "extra_addresses"
-#define KRB5_CONF_FORWARDABLE                 "forwardable"
-#define KRB5_CONF_HOST_BASED_SERVICES         "host_based_services"
-#define KRB5_CONF_HTTP_ANCHORS                "http_anchors"
-#define KRB5_CONF_IGNORE_ACCEPTOR_HOSTNAME    "ignore_acceptor_hostname"
-#define KRB5_CONF_IPROP_ENABLE                "iprop_enable"
-#define KRB5_CONF_IPROP_MASTER_ULOGSIZE       "iprop_master_ulogsize"
-#define KRB5_CONF_IPROP_PORT                  "iprop_port"
-#define KRB5_CONF_IPROP_SLAVE_POLL            "iprop_slave_poll"
-#define KRB5_CONF_IPROP_LOGFILE               "iprop_logfile"
-#define KRB5_CONF_IPROP_RESYNC_TIMEOUT        "iprop_resync_timeout"
-#define KRB5_CONF_K5LOGIN_AUTHORITATIVE       "k5login_authoritative"
-#define KRB5_CONF_K5LOGIN_DIRECTORY           "k5login_directory"
-#define KRB5_CONF_KADMIND_PORT                "kadmind_port"
-#define KRB5_CONF_KRB524_SERVER               "krb524_server"
-#define KRB5_CONF_KDC                         "kdc"
-#define KRB5_CONF_KDCDEFAULTS                 "kdcdefaults"
-#define KRB5_CONF_KDC_PORTS                   "kdc_ports"
-#define KRB5_CONF_KDC_TCP_PORTS               "kdc_tcp_ports"
-#define KRB5_CONF_MAX_DGRAM_REPLY_SIZE        "kdc_max_dgram_reply_size"
-#define KRB5_CONF_KDC_DEFAULT_OPTIONS         "kdc_default_options"
-#define KRB5_CONF_KDC_TIMESYNC                "kdc_timesync"
-#define KRB5_CONF_KDC_REQ_CHECKSUM_TYPE       "kdc_req_checksum_type"
-#define KRB5_CONF_KEY_STASH_FILE              "key_stash_file"
-#define KRB5_CONF_KPASSWD_PORT                "kpasswd_port"
-#define KRB5_CONF_KPASSWD_SERVER              "kpasswd_server"
-#define KRB5_CONF_LDAP_CONNS_PER_SERVER       "ldap_conns_per_server"
-#define KRB5_CONF_LDAP_KADMIN_DN              "ldap_kadmind_dn"
-#define KRB5_CONF_LDAP_KDC_DN                 "ldap_kdc_dn"
-#define KRB5_CONF_LDAP_KERBEROS_CONTAINER_DN  "ldap_kerberos_container_dn"
-#define KRB5_CONF_LDAP_SERVERS                "ldap_servers"
-#define KRB5_CONF_LDAP_SERVICE_PASSWORD_FILE  "ldap_service_password_file"
-#define KRB5_CONF_LIBDEFAULTS                 "libdefaults"
-#define KRB5_CONF_LOGGING                     "logging"
-#define KRB5_CONF_MASTER_KEY_NAME             "master_key_name"
-#define KRB5_CONF_MASTER_KEY_TYPE             "master_key_type"
-#define KRB5_CONF_MASTER_KDC                  "master_kdc"
-#define KRB5_CONF_MAX_LIFE                    "max_life"
-#define KRB5_CONF_MAX_RENEWABLE_LIFE          "max_renewable_life"
-#define KRB5_CONF_MODULE                      "module"
-#define KRB5_CONF_NOADDRESSES                 "noaddresses"
-#define KRB5_CONF_NO_HOST_REFERRAL            "no_host_referral"
-#define KRB5_CONF_PERMITTED_ENCTYPES          "permitted_enctypes"
-#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_PROXIABLE                   "proxiable"
-#define KRB5_CONF_RDNS                        "rdns"
-#define KRB5_CONF_REALMS                      "realms"
-#define KRB5_CONF_REALM_TRY_DOMAINS           "realm_try_domains"
-#define KRB5_CONF_REJECT_BAD_TRANSIT          "reject_bad_transit"
-#define KRB5_CONF_RENEW_LIFETIME              "renew_lifetime"
-#define KRB5_CONF_RESTRICT_ANONYMOUS_TO_TGT   "restrict_anonymous_to_tgt"
-#define KRB5_CONF_ASSUME_DES_CRC_SESSION      "des_crc_session_supported"
-#define KRB5_CONF_SAFE_CHECKSUM_TYPE          "safe_checksum_type"
-#define KRB5_CONF_SUPPORTED_ENCTYPES          "supported_enctypes"
-#define KRB5_CONF_TICKET_LIFETIME             "ticket_lifetime"
-#define KRB5_CONF_UDP_PREFERENCE_LIMIT        "udp_preference_limit"
-#define KRB5_CONF_VERIFY_AP_REQ_NOFAIL        "verify_ap_req_nofail"
-#define KRB5_CONF_V4_INSTANCE_CONVERT         "v4_instance_convert"
-#define KRB5_CONF_V4_REALM                    "v4_realm"
+/* Profile variables.  Constants are named KRB5_CONF_STRING, where STRING
+ * matches the variable name.  Keep these alphabetized. */
+#define KRB5_CONF_ACL_FILE                     "acl_file"
+#define KRB5_CONF_ADMIN_SERVER                 "admin_server"
+#define KRB5_CONF_ALLOW_WEAK_CRYPTO            "allow_weak_crypto"
+#define KRB5_CONF_AP_REQ_CHECKSUM_TYPE         "ap_req_checksum_type"
+#define KRB5_CONF_AUTH_TO_LOCAL                "auth_to_local"
+#define KRB5_CONF_AUTH_TO_LOCAL_NAMES          "auth_to_local_names"
+#define KRB5_CONF_CANONICALIZE                 "canonicalize"
+#define KRB5_CONF_CCACHE_TYPE                  "ccache_type"
+#define KRB5_CONF_CLOCKSKEW                    "clockskew"
+#define KRB5_CONF_DATABASE_NAME                "database_name"
+#define KRB5_CONF_DB_MODULE_DIR                "db_module_dir"
+#define KRB5_CONF_DEFAULT                      "default"
+#define KRB5_CONF_DEFAULT_CCACHE_NAME          "default_ccache_name"
+#define KRB5_CONF_DEFAULT_CLIENT_KEYTAB_NAME   "default_client_keytab_name"
+#define KRB5_CONF_DEFAULT_DOMAIN               "default_domain"
+#define KRB5_CONF_DEFAULT_KEYTAB_NAME          "default_keytab_name"
+#define KRB5_CONF_DEFAULT_PRINCIPAL_EXPIRATION "default_principal_expiration"
+#define KRB5_CONF_DEFAULT_PRINCIPAL_FLAGS      "default_principal_flags"
+#define KRB5_CONF_DEFAULT_REALM                "default_realm"
+#define KRB5_CONF_DEFAULT_TGS_ENCTYPES         "default_tgs_enctypes"
+#define KRB5_CONF_DEFAULT_TKT_ENCTYPES         "default_tkt_enctypes"
+#define KRB5_CONF_DES_CRC_SESSION_SUPPORTED    "des_crc_session_supported"
+#define KRB5_CONF_DICT_FILE                    "dict_file"
+#define KRB5_CONF_DISABLE                      "disable"
+#define KRB5_CONF_DISABLE_LAST_SUCCESS         "disable_last_success"
+#define KRB5_CONF_DISABLE_LOCKOUT              "disable_lockout"
+#define KRB5_CONF_DNS_CANONICALIZE_HOSTNAME    "dns_canonicalize_hostname"
+#define KRB5_CONF_DNS_FALLBACK                 "dns_fallback"
+#define KRB5_CONF_DNS_LOOKUP_KDC               "dns_lookup_kdc"
+#define KRB5_CONF_DNS_LOOKUP_REALM             "dns_lookup_realm"
+#define KRB5_CONF_DOMAIN_REALM                 "domain_realm"
+#define KRB5_CONF_ENABLE_ONLY                  "enable_only"
+#define KRB5_CONF_EXTRA_ADDRESSES              "extra_addresses"
+#define KRB5_CONF_FORWARDABLE                  "forwardable"
+#define KRB5_CONF_HOST_BASED_SERVICES          "host_based_services"
+#define KRB5_CONF_HTTP_ANCHORS                 "http_anchors"
+#define KRB5_CONF_IGNORE_ACCEPTOR_HOSTNAME     "ignore_acceptor_hostname"
+#define KRB5_CONF_IPROP_ENABLE                 "iprop_enable"
+#define KRB5_CONF_IPROP_LOGFILE                "iprop_logfile"
+#define KRB5_CONF_IPROP_MASTER_ULOGSIZE        "iprop_master_ulogsize"
+#define KRB5_CONF_IPROP_PORT                   "iprop_port"
+#define KRB5_CONF_IPROP_RESYNC_TIMEOUT         "iprop_resync_timeout"
+#define KRB5_CONF_IPROP_SLAVE_POLL             "iprop_slave_poll"
+#define KRB5_CONF_K5LOGIN_AUTHORITATIVE        "k5login_authoritative"
+#define KRB5_CONF_K5LOGIN_DIRECTORY            "k5login_directory"
+#define KRB5_CONF_KADMIND_PORT                 "kadmind_port"
+#define KRB5_CONF_KDC                          "kdc"
+#define KRB5_CONF_KDCDEFAULTS                  "kdcdefaults"
+#define KRB5_CONF_KDC_DEFAULT_OPTIONS          "kdc_default_options"
+#define KRB5_CONF_KDC_MAX_DGRAM_REPLY_SIZE     "kdc_max_dgram_reply_size"
+#define KRB5_CONF_KDC_PORTS                    "kdc_ports"
+#define KRB5_CONF_KDC_REQ_CHECKSUM_TYPE        "kdc_req_checksum_type"
+#define KRB5_CONF_KDC_TCP_PORTS                "kdc_tcp_ports"
+#define KRB5_CONF_KDC_TIMESYNC                 "kdc_timesync"
+#define KRB5_CONF_KEY_STASH_FILE               "key_stash_file"
+#define KRB5_CONF_KPASSWD_PORT                 "kpasswd_port"
+#define KRB5_CONF_KPASSWD_SERVER               "kpasswd_server"
+#define KRB5_CONF_KRB524_SERVER                "krb524_server"
+#define KRB5_CONF_LDAP_CONNS_PER_SERVER        "ldap_conns_per_server"
+#define KRB5_CONF_LDAP_KADMIND_DN              "ldap_kadmind_dn"
+#define KRB5_CONF_LDAP_KDC_DN                  "ldap_kdc_dn"
+#define KRB5_CONF_LDAP_KERBEROS_CONTAINER_DN   "ldap_kerberos_container_dn"
+#define KRB5_CONF_LDAP_SERVERS                 "ldap_servers"
+#define KRB5_CONF_LDAP_SERVICE_PASSWORD_FILE   "ldap_service_password_file"
+#define KRB5_CONF_LIBDEFAULTS                  "libdefaults"
+#define KRB5_CONF_LOGGING                      "logging"
+#define KRB5_CONF_MASTER_KDC                   "master_kdc"
+#define KRB5_CONF_MASTER_KEY_NAME              "master_key_name"
+#define KRB5_CONF_MASTER_KEY_TYPE              "master_key_type"
+#define KRB5_CONF_MAX_LIFE                     "max_life"
+#define KRB5_CONF_MAX_RENEWABLE_LIFE           "max_renewable_life"
+#define KRB5_CONF_MODULE                       "module"
+#define KRB5_CONF_NOADDRESSES                  "noaddresses"
+#define KRB5_CONF_NO_HOST_REFERRAL             "no_host_referral"
+#define KRB5_CONF_PERMITTED_ENCTYPES           "permitted_enctypes"
+#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_PROXIABLE                    "proxiable"
+#define KRB5_CONF_RDNS                         "rdns"
+#define KRB5_CONF_REALMS                       "realms"
+#define KRB5_CONF_REALM_TRY_DOMAINS            "realm_try_domains"
+#define KRB5_CONF_REJECT_BAD_TRANSIT           "reject_bad_transit"
+#define KRB5_CONF_RENEW_LIFETIME               "renew_lifetime"
+#define KRB5_CONF_RESTRICT_ANONYMOUS_TO_TGT    "restrict_anonymous_to_tgt"
+#define KRB5_CONF_SAFE_CHECKSUM_TYPE           "safe_checksum_type"
+#define KRB5_CONF_SUPPORTED_ENCTYPES           "supported_enctypes"
+#define KRB5_CONF_TICKET_LIFETIME              "ticket_lifetime"
+#define KRB5_CONF_UDP_PREFERENCE_LIMIT         "udp_preference_limit"
+#define KRB5_CONF_V4_INSTANCE_CONVERT          "v4_instance_convert"
+#define KRB5_CONF_V4_REALM                     "v4_realm"
+#define KRB5_CONF_VERIFY_AP_REQ_NOFAIL         "verify_ap_req_nofail"
 
 /* Cache configuration variables */
-#define KRB5_CC_CONF_FAST_AVAIL                  "fast_avail"
-#define KRB5_CC_CONF_PROXY_IMPERSONATOR          "proxy_impersonator"
-#define KRB5_CC_CONF_REFRESH_TIME                "refresh_time"
-#define KRB5_CC_CONF_PA_TYPE                     "pa_type"
-#define KRB5_CC_CONF_PA_CONFIG_DATA              "pa_config_data"
+#define KRB5_CC_CONF_FAST_AVAIL                "fast_avail"
+#define KRB5_CC_CONF_PA_CONFIG_DATA            "pa_config_data"
+#define KRB5_CC_CONF_PA_TYPE                   "pa_type"
+#define KRB5_CC_CONF_PROXY_IMPERSONATOR        "proxy_impersonator"
+#define KRB5_CC_CONF_REFRESH_TIME              "refresh_time"
 
 /* Error codes used in KRB_ERROR protocol messages.
    Return values of library routines are based on a different error table
diff --git a/src/kdc/main.c b/src/kdc/main.c
index a7ffe63..c2bc6c2 100644
--- a/src/kdc/main.c
+++ b/src/kdc/main.c
@@ -289,7 +289,7 @@ init_realm(kdc_realm_t *rdp, krb5_pointer aprof, char *realm, char *def_mpname,
         rdp->realm_reject_bad_transit = TRUE;
 
     /* Handle assume des-cbc-crc is supported for session keys */
-    hierarchy[2] = KRB5_CONF_ASSUME_DES_CRC_SESSION;
+    hierarchy[2] = KRB5_CONF_DES_CRC_SESSION_SUPPORTED;
     if (krb5_aprof_get_boolean(aprof, hierarchy, TRUE,
                                &rdp->realm_assume_des_crc_sess))
         rdp->realm_assume_des_crc_sess = TRUE;
@@ -635,7 +635,7 @@ initialize_realms(krb5_context kcontext, int argc, char **argv)
         hierarchy[1] = KRB5_CONF_KDC_TCP_PORTS;
         if (krb5_aprof_get_string(aprof, hierarchy, TRUE, &default_tcp_ports))
             default_tcp_ports = 0;
-        hierarchy[1] = KRB5_CONF_MAX_DGRAM_REPLY_SIZE;
+        hierarchy[1] = KRB5_CONF_KDC_MAX_DGRAM_REPLY_SIZE;
         if (krb5_aprof_get_int32(aprof, hierarchy, TRUE, &max_dgram_reply_size))
             max_dgram_reply_size = MAX_DGRAM_SIZE;
         hierarchy[1] = KRB5_CONF_RESTRICT_ANONYMOUS_TO_TGT;
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
index 8d72832..a0664bc 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
@@ -373,7 +373,7 @@ krb5_ldap_read_server_params(krb5_context context, char *conf_section,
         if (srv_type == KRB5_KDB_SRV_TYPE_KDC)
             name = KRB5_CONF_LDAP_KDC_DN;
         else if (srv_type == KRB5_KDB_SRV_TYPE_ADMIN)
-            name = KRB5_CONF_LDAP_KADMIN_DN;
+            name = KRB5_CONF_LDAP_KADMIND_DN;
 
         if (name) {
             st = prof_get_string_def (context, conf_section, name,


More information about the cvs-krb5 mailing list