commit 1898f9f52ae2c6897b9f6f61205aa9b5d9e0520e
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Tue Jul 20 22:28:41 2010 +0000
ticket: 6744
version_fixed: 1.8.3
status: resolved
pull up r24138 from trunk
------------------------------------------------------------------------
r24138 | tlyu | 2010-06-18 15:41:48 -0400 (Fri, 18 Jun 2010) | 13 lines
ticket: 6744
subject: only test t_locate_kdc if known-good DNS name is present
target_version: 1.8.3
tags: pullup
Running "make check" while offline or on a firewalled network may
result in failure in lib/krb5/os because the invocation of
t_locate_kdc requires that the DNS servers for ATHENA.MIT.EDU be
reachable. Autodetect DNS utilities "dig" and "nslookup", and use
them to check for existence of the known-good DNS name. Also
parameterize the test so that the known-good DNS name can be
overridden on the make command line.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@24195 dc483132-0cff-0310-8789-dd5450dbe970
src/configure.in | 5 +++++
src/lib/krb5/os/Makefile.in | 26 ++++++++++++++++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/src/configure.in b/src/configure.in
index d4647cb..e353065 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -662,6 +662,11 @@ int main () {
AC_MSG_RESULT($ac_cv_printf_positional)
+# for t_locate_kdc test
+
+AC_PATH_PROG(DIG, dig, false)
+AC_PATH_PROG(NSLOOKUP, nslookup, false)
+
# for kadmin
AC_PROG_YACC
diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in
index 6a1ffd1..4da3ebf 100644
--- a/src/lib/krb5/os/Makefile.in
+++ b/src/lib/krb5/os/Makefile.in
@@ -189,7 +189,9 @@ lclint-localaddr: localaddr.c
$(LCLINT) $(LCLINTOPTS) $(CPPFLAGS) $(LOCALINCLUDES) $(DEFS) \
-DTEST $(srcdir)/localaddr.c
-check-unix:: $(TEST_PROGS)
+check-unix:: check-unix-stdconf check-unix-locate check-unix-antoln
+
+check-unix-stdconf:: t_std_conf
KRB5_CONFIG=$(srcdir)/td_krb5.conf ; export KRB5_CONFIG ;\
$(KRB5_RUN_ENV) $(VALGRIND) ./t_std_conf -d -s NEW.DEFAULT.REALM -d \
-k IGGY.ORG -k DEFAULT_REALM.TST \
@@ -198,17 +200,29 @@ check-unix:: $(TEST_PROGS)
-r pgp.good.idea -r no_domain > test.out
cmp test.out $(srcdir)/ref_std_conf.out
$(RM) test.out
- KRB5_CONFIG=$(srcdir)/td_krb5.conf ; export KRB5_CONFIG ;\
- if test "$(OFFLINE)" != yes; then \
- $(KRB5_RUN_ENV) $(VALGRIND) ./t_locate_kdc ATHENA.MIT.EDU; \
+
+# The following can be overriden on the make command line if needed:
+LOCREALM = ATHENA.MIT.EDU
+SRVNAME = _kerberos._udp.athena.mit.edu.
+DIGPAT = '^_kerberos.*srv'
+NSPAT = '^_kerberos.*service'
+DIG = @DIG@
+NSLOOKUP = @NSLOOKUP@
+
+check-unix-locate:: t_locate_kdc
+ if [ "$(OFFLINE)" = no ] && \
+ $(DIG) $(SRVNAME) srv | grep -i $(DIGPAT) || \
+ $(NSLOOKUP) -q=srv $(SRVNAME) | grep -i $(NSPAT); then \
+ KRB5_CONFIG=$(srcdir)/td_krb5.conf ; export KRB5_CONFIG ;\
+ $(KRB5_RUN_ENV) $(VALGRIND) ./t_locate_kdc $(LOCREALM); \
else \
- echo SKIPPING t_locate_kdc TEST WHILE OFFLINE; \
+ echo '*** WARNING: skipped t_locate_kdc test: known DNS name not found'; \
fi
#
# Do some aname-to-lname testing.
#
-check-unix::
+check-unix-antoln:: t_an_to_ln
echo '[libdefaults]' > ./t_an.conf
echo ' default_realm = r' >> ./t_an.conf
echo '[realms]' >> ./t_an.conf
commit 482967a673cede9d0140d8b5ead78a2e6397bdcb
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Thu Jun 10 18:14:11 2010 +0000
README and patchlevel for krb5-1.8.2
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@24127 dc483132-0cff-0310-8789-dd5450dbe970
README | 2 ++
src/patchlevel.h | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/README b/README
index fddc00b..9310c2d 100644
--- a/README
+++ b/README
@@ -324,6 +324,7 @@ Past and present Sponsors of the MIT Kerberos Consortium:
Microsoft
The National Aeronautics and Space Administration
of the United States of America (NASA)
+ Network Appliance (NetApp)
Nippon Telephone and Telegraph (NTT)
Oracle
Pennsylvania State University
@@ -332,6 +333,7 @@ Past and present Sponsors of the MIT Kerberos Consortium:
TeamF1, Inc.
The University of Alaska
The University of Michigan
+ The University of Pennsylvania
Past and present members of the Kerberos Team at MIT:
diff --git a/src/patchlevel.h b/src/patchlevel.h
index f84a0c9..e8a08c0 100644
--- a/src/patchlevel.h
+++ b/src/patchlevel.h
@@ -53,6 +53,6 @@
#define KRB5_MAJOR_RELEASE 1
#define KRB5_MINOR_RELEASE 8
#define KRB5_PATCHLEVEL 2
-#define KRB5_RELTAIL "beta1-postrelease"
+/* #undef KRB5_RELTAIL */
/* #undef KRB5_RELDATE */
-#define KRB5_RELTAG "branches/krb5-1-8"
+#define KRB5_RELTAG "tags/krb5-1-8-2-final"
commit 4ba8cb9423ae395ed48d896890e876f1247412d7
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Fri May 28 18:41:45 2010 +0000
ticket: 6734
version_fixed: 1.8.2
status: resolved
pull up r24102 from trunk
------------------------------------------------------------------------
r24102 | ghudson | 2010-05-24 22:44:45 -0400 (Mon, 24 May 2010) | 11 lines
ticket: 6734
subject: FAST negotiation could erroneously succeed
target_version: 1.8.2
tags: pullup
When FAST negotiation is performed against an older KDC
(rep->enc_part2->flags & TKT_FLG_ENC_PA_REP not set),
krb5int_fast_verify_nego did not set the value of *fast_avail, causing
stack garbage to be used in init_creds_step_reply. Initialize
*fast_avail at the beginning of the function per coding practices.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@24111 dc483132-0cff-0310-8789-dd5450dbe970
src/lib/krb5/krb/fast.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/lib/krb5/krb/fast.c b/src/lib/krb5/krb/fast.c
index 1ff2d67..e991261 100644
--- a/src/lib/krb5/krb/fast.c
+++ b/src/lib/krb5/krb/fast.c
@@ -572,6 +572,7 @@ krb5int_fast_verify_nego(krb5_context context,
krb5_data scratch;
krb5_boolean valid;
+ *fast_avail = FALSE;
if (rep->enc_part2->flags& TKT_FLG_ENC_PA_REP) {
pa = krb5int_find_pa_data(context, rep->enc_part2->enc_padata,
KRB5_ENCPADATA_REQ_ENC_PA_REP);
commit a3ea5a28ebacb79a9a4e95b5b574a140d8bfc064
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Thu May 20 22:57:53 2010 +0000
ticket: 6730
version_fixed: 1.8.2
status: resolved
pull up r24074 from trunk
------------------------------------------------------------------------
r24074 | tlyu | 2010-05-20 16:42:26 -0400 (Thu, 20 May 2010) | 11 lines
ticket: 6730
subject: kdc_tcp_ports not documented in kdc.conf.M
target_version: 1.8.2
tags: pullup
The kdc.conf setting kdc_tcp_ports was not documented in kdc.conf.M,
though it was documented in doc/admin.texinfo. Copy text from there
for now. The setting defaults to an empty string at the moment,
causing the KDC to not listen on TCP by default, confusing some users.
Changing this behavior is a separate issue.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@24077 dc483132-0cff-0310-8789-dd5450dbe970
src/config-files/kdc.conf.M | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/config-files/kdc.conf.M b/src/config-files/kdc.conf.M
index 4d3576d..db7d5a6 100644
--- a/src/config-files/kdc.conf.M
+++ b/src/config-files/kdc.conf.M
@@ -53,7 +53,17 @@ This relation lists the ports which the Kerberos server should listen
on, by default. This list is a comma separated list of integers. If
this relation is not specified, the compiled-in default is usually
port 88 and port 750.
+.IP kdc_tcp_ports
+This relation lists the ports on which the Kerberos server should
+listen for TCP connections by default. This list is a comma separated
+list of integers.
+If this relation is not specified, the compiled-in default is not to
+listen for TCP connections at all.
+If you wish to change this (which we do not recommend, because the
+current implementation has little protection against denial-of-service
+attacks), the standard port number assigned for Kerberos TCP traffic
+is port 88.
.IP v4_mode
This
.B string
@@ -201,6 +211,16 @@ as specified in the
.I [kdcdefaults]
section is used.
+.IP kdc_tcp_ports
+This
+.B string
+specifies the list of ports that the KDC is to listen to
+for TCP requests for this realm. By default, the value of
+.I kdc_tcp_ports
+as specified in the
+.I [kdcdefaults]
+section is used.
+
.IP master_key_name
This
.B string
commit 789fdf3068dbc35cd3a142ef9f02f7f576052f60
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Thu May 20 20:41:16 2010 +0000
ticket: 6562
version_fixed: 1.8.2
status: resolved
pull up r24055 from trunk
------------------------------------------------------------------------
r24055 | ghudson | 2010-05-18 13:19:15 -0400 (Tue, 18 May 2010) | 6 lines
ticket: 6562
When parsing a KDC or admin server string, allow the name or address
to be enclosed in brackets so that IPv6 addresses can be represented.
(IPv6 addresses contain colons, which look like port separators.)
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@24073 dc483132-0cff-0310-8789-dd5450dbe970
doc/admin.texinfo | 14 ++++++----
src/lib/kadm5/alt_prof.c | 39 ++++++++++++++++++++++++-----
src/lib/krb5/os/locate_kdc.c | 56 +++++++++++++++++------------------------
3 files changed, 63 insertions(+), 46 deletions(-)
---
diff --git a/doc/admin.texinfo b/doc/admin.texinfo
index 1ec4685..fbdc592 100644
--- a/doc/admin.texinfo
+++ b/doc/admin.texinfo
@@ -680,12 +680,14 @@ tags may be specified in the realm's subsection:
@table @b
@itemx kdc
-The name of a host running a KDC for that realm. An optional port
-number (separated from the hostname by a colon) may be included. For
-your computer to be able to communicate with the KDC for each realm,
-this tag must be given a value in each realm subsection in the
-configuration file, or there must be DNS SRV records specifying the
-KDCs (see @ref{Using DNS}).
+The name or address of a host running a KDC for that realm. An optional
+port number, separated from the hostname by a colon, may be included.
+If the name or address contains colons (for example, if it is an IPv6
+address), enclose it in square brackets to distinguish the colon from a
+port separator. For your computer to be able to communicate with the
+KDC for each realm, this tag must be given a value in each realm
+subsection in the configuration file, or there must be DNS SRV records
+specifying the KDCs (see @ref{Using DNS}).
@itemx master_kdc
Identifies the master KDC(s). Currently, this tag is used in only one
diff --git a/src/lib/kadm5/alt_prof.c b/src/lib/kadm5/alt_prof.c
index 5b967a0..7d28738 100644
--- a/src/lib/kadm5/alt_prof.c
+++ b/src/lib/kadm5/alt_prof.c
@@ -482,6 +482,36 @@ get_deltat_param(krb5_deltat *param_out, krb5_deltat param_in,
}
/*
+ * Parse out the port number from an admin_server setting. Modify server to
+ * contain just the hostname or address. If a port is given, set *port, and
+ * set the appropriate bit in *mask.
+ */
+static void
+parse_admin_server_port(char *server, int *port, long *mask)
+{
+ char *end, *portstr;
+
+ /* Allow the name or addr to be enclosed in brackets, for IPv6 addrs. */
+ if (*server == '[' && (end = strchr(server + 1, ']')) != NULL) {
+ portstr = (*(end + 1) == ':') ? end + 2 : NULL;
+ /* Shift the bracketed name or address back into server. */
+ memmove(server, server + 1, end - (server + 1));
+ *(end - 1) = '\0';
+ } else {
+ /* Terminate the name at the colon, if any. */
+ end = server + strcspn(server, ":");
+ portstr = (*end == ':') ? end + 1 : NULL;
+ *end = '\0';
+ }
+
+ /* If we found a port string, parse it and set the appropriate bit. */
+ if (portstr) {
+ *port = atoi(portstr);
+ *mask |= KADM5_CONFIG_KADMIND_PORT;
+ }
+}
+
+/*
* Function: kadm5_get_config_params
*
* Purpose: Merge configuration parameters provided by the caller with
@@ -581,13 +611,8 @@ krb5_error_code kadm5_get_config_params(context, use_kdc_config,
NULL);
if (params.mask & KADM5_CONFIG_ADMIN_SERVER) {
- char *p;
- p = strchr(params.admin_server, ':');
- if (p) {
- params.kadmind_port = atoi(p+1);
- params.mask |= KADM5_CONFIG_KADMIND_PORT;
- *p = '\0';
- }
+ parse_admin_server_port(params.admin_server, ¶ms.kadmind_port,
+ ¶ms.mask);
}
/* Get the value for the database */
diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c
index 0ecb2d9..d0134c1 100644
--- a/src/lib/krb5/os/locate_kdc.c
+++ b/src/lib/krb5/os/locate_kdc.c
@@ -374,19 +374,11 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm,
if (code == 0) {
for (i=0; masterlist[i]; i++) {
host = masterlist[i];
-
- /*
- * Strip off excess whitespace
- */
- cp = strchr(host, ' ');
- if (cp)
- *cp = 0;
- cp = strchr(host, '\t');
- if (cp)
- *cp = 0;
- cp = strchr(host, ':');
- if (cp)
- *cp = 0;
+ /* Strip off excess characters. */
+ if (*host == '[' && (cp = strchr(host, ']')))
+ *(cp + 1) = '\0';
+ else
+ *(host + strcspn(host, " \t:")) = '\0';
}
}
} else {
@@ -407,20 +399,13 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm,
host = hostlist[i];
Tprintf ("entry %d is '%s'\n", i, host);
- /*
- * Strip off excess whitespace
- */
- cp = strchr(host, ' ');
- if (cp)
- *cp = 0;
- cp = strchr(host, '\t');
- if (cp)
- *cp = 0;
- port = strchr(host, ':');
- if (port) {
- *port = 0;
- port++;
- }
+ /* Find port number, and strip off any excess characters. */
+ if (*host == '[' && (cp = strchr(host, ']')))
+ cp = cp + 1;
+ else
+ cp = host + strcspn(host, " \t:");
+ port = (*cp == ':') ? cp + 1 : NULL;
+ *cp = '\0';
ismaster = 0;
if (masterlist) {
@@ -454,15 +439,20 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm,
p2 = sec_udpport;
}
+ /* If the hostname was in brackets, strip those off now. */
+ if (*host == '[' && (cp = strchr(host, ']'))) {
+ host++;
+ *cp = '\0';
+ }
+
if (socktype != 0)
- code = add_host_to_list (addrlist, hostlist[i], p1, p2,
- socktype, family);
+ code = add_host_to_list(addrlist, host, p1, p2, socktype, family);
else {
- code = add_host_to_list (addrlist, hostlist[i], p1, p2,
- SOCK_DGRAM, family);
+ code = add_host_to_list(addrlist, host, p1, p2, SOCK_DGRAM,
+ family);
if (code == 0)
- code = add_host_to_list (addrlist, hostlist[i], p1, p2,
- SOCK_STREAM, family);
+ code = add_host_to_list(addrlist, host, p1, p2, SOCK_STREAM,
+ family);
}
if (code) {
Tprintf ("error %d (%s) returned from add_host_to_list\n", code,
commit 1bb245e6355bdd21c1db0afdfee446fd031833fe
Author: tlyu <tlyu@dc483132-0cff-0310-8789-dd5450dbe970>
Date: Wed May 19 18:52:46 2010 +0000
ticket: 6718
version_fixed: 1.8.2
status: resolved
pull up r24002 from trunk
------------------------------------------------------------------------
r24002 | ghudson | 2010-05-10 18:23:57 -0400 (Mon, 10 May 2010) | 14 lines
ticket: 6718
subject: Make KADM5_FAIL_AUTH_COUNT_INCREMENT more robust with LDAP
target_version: 1.8.2
tags: pullup
In krb5_ldap_put_principal, use krb5_get_attributes_mask to determine
whether krbLoginFailedCount existed on the entry when it was
retrieved. If it didn't exist, don't try to use LDAP_MOD_INCREMENT,
and don't assert an old value when not using LDAP_MOD_INCREMENT.
Also, create the krbLoginFailedCount attribute when creating new
entries. This allows us to use LDAP_MOD_INCREMENT during the first
failed login (if the server supports it), avoiding a race condition.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@24061 dc483132-0cff-0310-8789-dd5450dbe970
src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c | 51 +++++++++++--------
1 files changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
index 220602a..7ad31da 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
@@ -891,6 +891,16 @@ krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entries,
if (st != 0)
goto cleanup;
} else if (entries->mask & KADM5_FAIL_AUTH_COUNT_INCREMENT) {
+ int attr_mask = 0;
+ krb5_boolean has_fail_count;
+
+ /* Check if the krbLoginFailedCount attribute exists. (Through
+ * krb5 1.8.1, it wasn't set in new entries.) */
+ st = krb5_get_attributes_mask(context, entries, &attr_mask);
+ if (st != 0)
+ goto cleanup;
+ has_fail_count = ((attr_mask & KDB_FAIL_AUTH_COUNT_ATTR) != 0);
+
/*
* If the client library and server supports RFC 4525,
* then use it to increment by one the value of the
@@ -898,38 +908,35 @@ krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entries,
* (provided) old value by deleting it before adding.
*/
#ifdef LDAP_MOD_INCREMENT
- if (ldap_server_handle->server_info->modify_increment) {
+ if (ldap_server_handle->server_info->modify_increment &&
+ has_fail_count) {
st = krb5_add_int_mem_ldap_mod(&mods, "krbLoginFailedCount",
LDAP_MOD_INCREMENT, 1);
if (st != 0)
goto cleanup;
- } else
+ } else {
#endif /* LDAP_MOD_INCREMENT */
- if (entries->fail_auth_count == 0) {
- /*
- * Unfortunately we have no way of distinguishing between
- * an absent and a zero-valued attribute by the time we are
- * called here. So, although this creates a race condition,
- * it appears impossible to assert the old value as that
- * would fail were the attribute absent.
- */
- st = krb5_add_int_mem_ldap_mod(&mods, "krbLoginFailedCount",
- LDAP_MOD_REPLACE, 1);
- if (st != 0)
- goto cleanup;
- } else {
- st = krb5_add_int_mem_ldap_mod(&mods, "krbLoginFailedCount",
+ if (has_fail_count) {
+ st = krb5_add_int_mem_ldap_mod(&mods,
+ "krbLoginFailedCount",
LDAP_MOD_DELETE,
entries->fail_auth_count);
if (st != 0)
goto cleanup;
-
- st = krb5_add_int_mem_ldap_mod(&mods, "krbLoginFailedCount",
- LDAP_MOD_ADD,
- entries->fail_auth_count + 1);
- if (st != 0)
- goto cleanup;
}
+ st = krb5_add_int_mem_ldap_mod(&mods, "krbLoginFailedCount",
+ LDAP_MOD_ADD,
+ entries->fail_auth_count + 1);
+ if (st != 0)
+ goto cleanup;
+#ifdef LDAP_MOD_INCREMENT
+ }
+#endif
+ } else if (optype == ADD_PRINCIPAL) {
+ /* Initialize krbLoginFailedCount in new entries to help avoid a
+ * race during the first failed login. */
+ st = krb5_add_int_mem_ldap_mod(&mods, "krbLoginFailedCount",
+ LDAP_MOD_ADD, 0);
}
if (entries->mask & KADM5_MAX_LIFE) {