asn/mit-krb5.git
10 years agoCheck for asprintf failure in kdb5_util create master
Tomas Kuthan [Thu, 10 Apr 2014 13:16:06 +0000 (15:16 +0200)]
Check for asprintf failure in kdb5_util create

In add_admin_princ, remove build_name_with_realm and call asprintf
directly instead.  Check for asprintf failure to avoid passing an
undefined pointer to krb5_parse_name.

[ghudson@mit.edu: rewrite commit message]

ticket: 7902 (new)
target_version: 1.12.2
tags: pullup

10 years agoIn PKINIT, use library initializer for OpenSSL
Tomas Kuthan [Fri, 11 Apr 2014 13:36:53 +0000 (15:36 +0200)]
In PKINIT, use library initializer for OpenSSL

Use a library initializer to prevent multiple threads using PKINIT
from concurently initializing OpenSSL functions.  For cases where
MT-safety is not assured by registering OpenSSL locking callbacks,
this significantly lowers the odds of crashes caused by races in
OpenSSL initialization.  (If OpenSSL initialization functions are
called by some other thread directly, crashes are still possible.)

[ghudson@mit.edu: simplify code changes and commit message]

ticket: 6413

10 years agoUpdate sample configs to include master_kdc
Greg Hudson [Tue, 8 Apr 2014 18:07:30 +0000 (14:07 -0400)]
Update sample configs to include master_kdc

Where we have ATHENA.MIT.EDU stanzas in sample or test krb5.conf files
which define kdc entries, also define a master_kdc entry.  Remove
default_domain and v4_instance_convert entries in examples as they are
only needed for krb5/krb4 principal conversions.  In the krb5_conf.rst
example, remove enctype specifications as we don't want to encourage
their use when they aren't necessary, and remove a redundant
domain_realm entry.

ticket: 7901 (new)

10 years agoFix sendto_kdc.c on OS X after cm refactoring
Greg Hudson [Fri, 4 Apr 2014 18:58:33 +0000 (14:58 -0400)]
Fix sendto_kdc.c on OS X after cm refactoring

Treat POLLHUP without POLLIN or POLLOUT as an exception in the poll
version of cm_get_ssflags, to correctly handle TCP connection errors
on OS X.

10 years agoRemove adb_policy_init and adb_policy_close
Tomas Kuthan [Thu, 3 Apr 2014 15:58:43 +0000 (17:58 +0200)]
Remove adb_policy_init and adb_policy_close

Since f72c3ffa the policy is initialized as part of database.
adb_policy_close is now a no-op, and adb_policy_init just makes sure
the database is initialized.  adb_policy_init is only called from
kadm5_flush, and only if database initialization was successful
beforehand, rendering this call redundant.

Remove adb_policy_init and adb_policy_close and all their references
in the code and documentation.

10 years agoFix leak in kadm5_flush with LDAP KDB
Tomas Kuthan [Wed, 2 Apr 2014 15:48:04 +0000 (17:48 +0200)]
Fix leak in kadm5_flush with LDAP KDB

Due to an inverted test in adb_policy_init, kadm5_flush calls
krb5_db_open twice.  With the DB2 KDB module, the second open is a
no-op, but with the LDAP module, a new DB handle is allocated and the
old one is leaked.

[ghudson@mit.edu: rewrote commit message]

ticket: 7897 (new)
target_version: 1.12.2
tags: pullup

10 years agoRefactor cm functions in sendto_kdc.c
Greg Hudson [Wed, 26 Mar 2014 17:21:45 +0000 (13:21 -0400)]
Refactor cm functions in sendto_kdc.c

Move get_curtime_ms and the cm functions near the top of the file
right after structure definitions.  Except for cm_select_or_poll,
define each cm function separately for poll and for select, since the
implementations don't share much in common.  Instead of
cm_unset_write, define cm_read and cm_write functions to put an fd in
read-only or write-only state.  Remove the ssflags argument from
cm_add_fd and just expect the caller to make a subsequent call to
cm_read or cm_write.  Always select for exceptions when using select.
(Polling for exceptions is implicit with poll).

With these changes, we no longer select/poll for reading on a TCP
connection until we are done writing to it.  So in service_tcp_fd,
remove the check for unexpected read events.

10 years agoGet getopt from unistd.h (not getopt.h) in tests
Greg Hudson [Fri, 28 Mar 2014 16:33:43 +0000 (12:33 -0400)]
Get getopt from unistd.h (not getopt.h) in tests

POSIX defines getopt to be declared in unistd.h, and HP-UX (as of
version 11.31) does not appear to have getopt.h.  In test programs
which currently include getopt.h and aren't currently built on
Windows, include unistd.h or just assume we will get it via k5-int.h.

ticket: 7894 (new)
target_version: 1.12.2
tags: pullup

10 years agoFix t_seqstate build with Solaris compiler
Greg Hudson [Tue, 25 Mar 2014 16:28:05 +0000 (12:28 -0400)]
Fix t_seqstate build with Solaris compiler

The Solaris native compiler (as of version 5.9) outputs code for
static inline functions even if they are not used.  So the
k5buf_to_gss helper in gssapiP_generic.h causes t_seqstate to have a
dependency on libkrb5support.

ticket: 7872

10 years agoDon't free cred handle used in kadm5 server handle
Tomas Kuthan [Wed, 26 Mar 2014 16:04:30 +0000 (17:04 +0100)]
Don't free cred handle used in kadm5 server handle

At the end of setup_gss(), gss_client_creds is released, but an alias
to the credential handle is saved in kadm5_server_handle_t in
handle->clnt->cl_auth->(struct rpc_gss_data *)ah_private->sec.cred.
Accessing these credentials (by authgss_refresh) can result in use
after free.

This fix stores credential reference in server handle and releases
the credentials in kadm5_destroy.

[ghudson@mit.edu: initialize handle->cred to correct constant; get rid
of gss_client_creds variable; clarify commit message slightly]

ticket: 7891 (new)

10 years agoImprove salt type display in kadmin getprinc
Greg Hudson [Fri, 21 Mar 2014 22:07:41 +0000 (18:07 -0400)]
Improve salt type display in kadmin getprinc

In krb5_salttype_to_string, output the salt type name we would
recognize as input.

In the output of getprinc, display the enctype and salt type in a form
we would accept--either enctype:salttype if the salt type is not the
default, or just the enctype if it is.

Update t_mkey.py and t_salt.py to expect the new output format.
Update documentation examples to show the new format.

ticket: 5958

10 years agoUpdate example kadmin getprinc enctype display
Greg Hudson [Wed, 26 Mar 2014 19:57:08 +0000 (15:57 -0400)]
Update example kadmin getprinc enctype display

In kadmin_local.rst, update the example to reflect the new way we
display enctypes after #5014.

ticket: 7890 (new)
target_version: 1.12.2
tags: pullup

10 years agoFix minor typo in options2configure.rst
Alok Menghrajani [Tue, 11 Mar 2014 17:12:16 +0000 (10:12 -0700)]
Fix minor typo in options2configure.rst

--with-crypto=openssl is incorrect; it's --with-crypto-impl=openssl.

[ghudson@mit.edu: wrap source line at 70 columns; improve grammar of
the next sentence]

10 years agoModernize default_state.c
Greg Hudson [Tue, 25 Mar 2014 14:52:38 +0000 (10:52 -0400)]
Modernize default_state.c

Use alloc_data() and empty_data() where appropriate.  Keep mainline
logic to the left where possible.  Name the output parameter of
krb5int_des_init_state with an _out suffix.  Use a professional tone
in comments.  Partly based on a patch from Alok Menghrajani.

10 years agoUse anonymous OIDs in pkinit_crypto_openssl.c
Greg Hudson [Tue, 25 Mar 2014 02:42:02 +0000 (22:42 -0400)]
Use anonymous OIDs in pkinit_crypto_openssl.c

Stop adding OIDs to the global OpenSSL table.  It isn't thread-safe
(even with locking callbacks registered), and calling OBJ_cleanup
could break other uses of OpenSSL.  Instead, use anonymous OIDs
created with OBJ_txt2oid.  Anonymous OIDs need to be managed more
careful to avoid double-freeing, so create a copy before calling
PKCS7_add_signed_attribute, and don't free the result of
pkinit_pkcs7type2oid in cms_contentinfo_create.

ticket: 7889

10 years agoStop shadowing id-pkcs7-data OID
Greg Hudson [Mon, 24 Mar 2014 22:26:50 +0000 (18:26 -0400)]
Stop shadowing id-pkcs7-data OID

pkinit_crypto_openssl.c currently creates a shadow entry for
id-pkcs7-data so that OpenSSL will expect to see the corresponding
octet string in d.other instead than d.data.  This shadowing is very
unfriendly to other uses of OpenSSL and we should stop.  Eliminate the
shadowing and rewrite create_contentinfo so that it sets up the PKCS7
object correctly if the OID is id-pkcs7-data.

ticket: 7889

10 years agoFix a harmless DNS glue macro bug
Will Fiveash [Fri, 21 Mar 2014 16:46:08 +0000 (12:46 -0400)]
Fix a harmless DNS glue macro bug

The definition of SAFE_GETUINT16 mistakenly uses "p" instead its ptr
parameter in three places, which happens to work because all current
invocations of the macro use "p" as the ptr argument.  Fix it to
correctly use the ptr parameter.

[ghudson@mit.edu: commit message]

ticket: 6845

10 years agoMake use of strtoul() unconditional in locate_kdc
Nalin Dahyabhai [Sat, 8 Feb 2014 01:14:24 +0000 (20:14 -0500)]
Make use of strtoul() unconditional in locate_kdc

When parsing port numbers, we previously attempted to conditionalize use
of strtoul() on whether or not it was available, falling back to atoi()
instead, but we did so in a way that would always fall back to using
atoi().  We also call strtoul() from elsewhere without that condition,
so we don't gain anything by trying to be careful about it here.

10 years agoDon't check kpasswd reply address
Nalin Dahyabhai [Wed, 9 Oct 2013 19:03:16 +0000 (15:03 -0400)]
Don't check kpasswd reply address

Don't check the address of the kpasswd server when parsing the reply
we received from it.  If the server's address was modified by a proxy
or other network element, the user will be incorrectly warned that the
password change failed when it succeeded.  The check is unnecessary as
the kpasswd protocol is not subject to a reflection attack.

[ghudson@mit.edu: edit commit message]

ticket: 7886 (new)

10 years agoAlways stat profile files after reopening them
Will Fiveash [Wed, 19 Mar 2014 21:48:15 +0000 (16:48 -0500)]
Always stat profile files after reopening them

Some applications write a profile file and then immediately use it via
a krb5_context.  If we have a cached copy of the profile we wrote,
make sure to update it by forcing a stat when we reuse an existing
prf_data_t object.

[ghudson@mit.edu: commit message]

ticket: 7884

10 years agoTry compatible keys in rd_req_dec "any" path
Nalin Dahyabhai [Tue, 18 Mar 2014 20:39:47 +0000 (16:39 -0400)]
Try compatible keys in rd_req_dec "any" path

When we go to decrypt a ticket using a keytab, we have two code paths.

In the first (traditional) one, we try to read an entry that exactly
matches the principal name, enctype, and kvno from the ticket, and then
attempt to decrypt the ticket using the entry's key.  The keytab
routines helpfully return an entry so long as it's of a key type that's
compatible with the ticket being decrypted, fixing up the enctype in the
entry structure while doing so, allowing us to decrypt a DES-CBC-CRC
ticket with a DES-CBC-MD5 key.

In the second code path, we try the key of every entry which loosely
matches the principal name from the ticket and which exactly matches its
enctype, meaning that the ticket/keytab pair above won't work if the
principal name is one which suggests we shouldn't be matching entries
exactly.

This change modifies the "any" path to also try to decrypt the ticket
with compatible keys.

[ghudson@mit.edu: avoid stuffing too much logic in one conditional]

ticket: 7883 (new)

10 years agoFix returning KDB_NOENTRY in find_alternate_tgs()
Nalin Dahyabhai [Thu, 20 Feb 2014 21:01:49 +0000 (16:01 -0500)]
Fix returning KDB_NOENTRY in find_alternate_tgs()

After searching for a cross-realm TGS entry to provide to a client as a
referral, if we're all set to return a success code but aren't actually
returning an entry, we should be returning an error.  We might not do so
because we don't compare the right value against NULL.

This corrects an error in a redundant check in the patch for
CVE-2013-1417.  The error in the check cannot occur in practice
because the other part of the patch for CVE-2013-1417 prevents it, but
static analyzers can flag the erroneous check.

[tlyu@mit.edu: edit commit message]

ticket: 7881 (new)
tags: pullup
target_version: 1.12.2

10 years agoImprove PKINIT client memory management
Greg Hudson [Fri, 14 Mar 2014 16:53:50 +0000 (12:53 -0400)]
Improve PKINIT client memory management

In pkinit_as_req_create, create and encode stack-allocated auth-pack
structures containing only alias pointers, instead of heap-allocated
structures containing a mix of alias pointers, owner pointers, and
appropriated caller memory.  Keep everything we temporarily allocate
in separate local variables and free them through those variables.

In pa_pkinit_gen_req, use safer memory practices to avoid problems
like issue #7878.  Free the checksum since pkinit_as_req_create no
longer takes ownership it.  Remove a broken overly defensive check
after calling pkinit_as_req_create.

Remove init_krb5_auth_pack and init_krb5_auth_pack_draft9 as they are
no longer required.

10 years agoFix unlikely double free in PKINIT client code
Greg Hudson [Thu, 13 Mar 2014 22:34:22 +0000 (18:34 -0400)]
Fix unlikely double free in PKINIT client code

In pa_pkinit_gen_req, if the cleanup handler is reached with non-zero
retval and non-null out_data, out_data is freed, then dereferenced,
then freed again.  This can only happen if one of the small fixed-size
malloc requests fails after pkinit_as_req_create succeeds, so it is
unlikely to occur in practice.

ticket: 7878 (new)
target_version: 1.12.2
tags: pullup

10 years agoRewrite GSS sequence state tracking code
Greg Hudson [Wed, 12 Mar 2014 16:13:08 +0000 (12:13 -0400)]
Rewrite GSS sequence state tracking code

Replace util_ordering.c with a new file util_seqstate.c, implemented
using a bitmap of previously received sequence numbers instead of a
20-element circular queue.  This approach has slightly different
limitations--it can check for replays for values within 64 of the
expected next number, where the old code could check within the range
of the last 20 received numbers regardless of how far apart they are.
The new approach should work as well or better for any realistic
packet reordering scenario.

ticket: 7879 (new)

10 years agoImprove internal API for GSS sequence numbers
Greg Hudson [Tue, 11 Mar 2014 03:01:40 +0000 (23:01 -0400)]
Improve internal API for GSS sequence numbers

Use an opaque structure type instead of a void pointer for the
sequence number state.  Rename all functions to use a g_seqstate
prefix rather than a mix of g_order and g_queue.  Remove the
unneccessary indirection from the state object parameter in
g_seqstate_check and g_seqstate_free.  Return OM_uint32 where we
return a GSS major code, long where we return an errno value, and void
where we can't fail.

10 years agoAdd tests for GSSAPI sequence number processing
Greg Hudson [Wed, 12 Mar 2014 15:03:48 +0000 (11:03 -0400)]
Add tests for GSSAPI sequence number processing

ticket: 7872

10 years agoFix GSS krb5 initial sequence number gap handling
Tomas Kuthan [Thu, 6 Mar 2014 12:05:24 +0000 (13:05 +0100)]
Fix GSS krb5 initial sequence number gap handling

Since #2040, the dummy queue element inserted by g_order_init no
longer compares less than the initial sequence number, so we fail when
the first few sequence numbers are received out of order.  Properly
detect when a sequence number fits between the dummy element and the
first real queue element.

[ghudson@mit.edu: rewrote commit message]

ticket: 7872
target_version: 1.12.2
tags: pullup

10 years agoDon't leak the per-request preauth context
Nalin Dahyabhai [Tue, 11 Mar 2014 17:33:23 +0000 (13:33 -0400)]
Don't leak the per-request preauth context

Currently, per-request preauth module data is only cleared when we
successfully obtain initial credentials.  Make sure to clear it at the
end of the operation even if we failed to get creds.

[ghudson@mit.edu: expanded commit message]

ticket: 7793
target_version: 1.12.2
tags: pullup

10 years agoMention k5login_authoritative in k5login docs
Ben Kaduk [Thu, 13 Mar 2014 19:11:49 +0000 (15:11 -0400)]
Mention k5login_authoritative in k5login docs

In particular, it is set by default.  This can lead to confusing
behavior wherein adding a k5login file removes a user's remote
access.

Make an example more concrete to account for this case.

ticket: 7876 (new)
target_version: 1.12.2
tags: pullup

10 years agoFix memory leak in krb5_verify_init_creds
Nalin Dahyabhai [Mon, 17 Feb 2014 22:14:20 +0000 (17:14 -0500)]
Fix memory leak in krb5_verify_init_creds

When copying most of the credentials from one cache to another in
copy_creds_except (called from get_vfy_cred, from
krb5_verify_init_creds), we need to free all of the credentials that
we read, not just the ones we copied.

[ghudson@mit.edu: edited commit message]

ticket: 7875 (new)
target_version: 1.12.2
tags: pullup

10 years agoInitialize err variable in krb5_sendto_kdc
Nalin Dahyabhai [Tue, 11 Mar 2014 17:26:32 +0000 (13:26 -0400)]
Initialize err variable in krb5_sendto_kdc

When we get an KRB5_KDC_UNREACH error back from k5_sendto, we check if
the err variable we passed for use by our message handler has been set
to KDC_ERR_SVC_UNAVAILABLE.  If k5_sendto doesn't receive any
response, though, the handler isn't called, so we're reading an
uninitialized variable.  Initialize it to a value other than
KDC_ERR_SVC_UNAVAILABLE to be sure.

[ghudson@mit.edu: initialize err just before calling k5_sendto; edit
commit message]

ticket: 7874 (new)
target_version: 1.12.2
tags: pullup

10 years agoUpdate iprop_master_ulogsize documentation
Greg Hudson [Fri, 7 Mar 2014 15:37:48 +0000 (10:37 -0500)]
Update iprop_master_ulogsize documentation

When we removed the maximum number of ulog entries (#7368), we did not
update the documentation for that parameter in kdc.conf.  Reported by
Richard Basch.

ticket: 7849
target_version: 1.12.2
tags: pullup

10 years agoFix clean-unix rule for gssapi_krb5.h
Tomas Kuthan [Fri, 7 Mar 2014 13:47:58 +0000 (14:47 +0100)]
Fix clean-unix rule for gssapi_krb5.h

Don't delete gssapi_krb5.h now that it is not generated.

[ghudson@mit.edu: also remove from generate-files-mac rule and from
.gitignore]

10 years agoModernize gic options code style
Greg Hudson [Wed, 5 Mar 2014 23:35:39 +0000 (18:35 -0500)]
Modernize gic options code style

10 years agoImprove extended gic option support
Greg Hudson [Sat, 1 Mar 2014 05:35:50 +0000 (00:35 -0500)]
Improve extended gic option support

The current extended gic option facility violates strict aliasing, is
not nestable (gic_opt_to_opte cannot be used on an extended options
structure casted back to krb5_get_init_creds_options), and requires
callers to use error-prone conversion functions.

Rewrite this code to use a new structure private to gic_opt.c, which
contains a krb5_get_init_creds_opt structure as its first member.  We
can cast between the extended structure and its first element without
violating strict aliasing (C99 6.7.2.1 paragraph 13 and the aggregate
type clause of 6.5 paragraph 7).  Define internal accessor functions
for the extended option fields.  Replace all uses of krb5_gic_opt_ext
in callers with krb5_get_init_creds_opt and the new accessors.  Bring
krb5_get_init_creds_opt_set_pa back into gic_opt.c (reverting
faa810c5b59fa33d9f7db837c5bb88df5436bb30) so that all of the code
which accesses the extended options structure can be in one file.

ticket: 6034

10 years agoAdd tests for gic_pwd password change
Greg Hudson [Sat, 1 Mar 2014 01:41:20 +0000 (20:41 -0500)]
Add tests for gic_pwd password change

ticket: 7868

10 years agoUse preauth options when changing password
Greg Hudson [Fri, 28 Feb 2014 19:49:35 +0000 (14:49 -0500)]
Use preauth options when changing password

If we try to change the password in rb5_get_init_creds_password, we
must use all application-specified gic options which affect
preauthentication when getting the kadmin/changepw ticket.  Create a
helper function make_chpw_options which copies the application's
options, unsets the options we don't want, and sets options
appropriate for a temporary ticket.

ticket: 7868

10 years agoCheck for malloc failure in process_chpw_request
Greg Hudson [Sun, 2 Mar 2014 23:12:54 +0000 (18:12 -0500)]
Check for malloc failure in process_chpw_request

ticket: 7866
target_version: 1.12.2
tags: pullup

10 years agoConditionalize use of LDAP_OPT_DEBUG_LEVEL
Greg Hudson [Fri, 28 Feb 2014 15:17:29 +0000 (10:17 -0500)]
Conditionalize use of LDAP_OPT_DEBUG_LEVEL

The LDAP debug level option (#7551) causes a build failure with the
Solaris LDAP library, which does not have LDAP_OPT_DEBUG_LEVEL.

ticket: 7870 (new)
target_version: 1.12.2
tags: pullup

10 years agoFix install rule for gssapi_krb5.h
Greg Hudson [Fri, 28 Feb 2014 05:30:05 +0000 (00:30 -0500)]
Fix install rule for gssapi_krb5.h

Revert r16428 now that gssapi_krb5.h is in the source tree.

10 years agoCorrect docs for "kdb5_util load" switches
Jeff D'Angelo [Fri, 28 Feb 2014 14:47:30 +0000 (09:47 -0500)]
Correct docs for "kdb5_util load" switches

Remove obsolete parenthetical statement in the description of the
"-update" switch to "kdb5_util load".  Using the "-update" flag to
load a second dump made using the "-ov" switch is no longer necessary
now that the "-r13" format is the default.  Add statement that the
"-b7" dump format was the default for versions prior to 1.2.2 (to
match the statement from "dump" section).

[tlyu@mit.edu: commit message]

ticket: 7865
tags: pullup
target_version: 1.12.2

10 years agoMissing type refs in docs due to stdint.h changes
Tom Yu [Thu, 27 Feb 2014 20:46:00 +0000 (15:46 -0500)]
Missing type refs in docs due to stdint.h changes

References to krb5_int16.rst and krb5_ui_2.rst were missing, but
recently began causing sphinx-build errors because Doxygen started
generating them after the stdint.h changes.

10 years agoFix two omissions in stdint.h changes
Greg Hudson [Wed, 26 Feb 2014 22:39:55 +0000 (17:39 -0500)]
Fix two omissions in stdint.h changes

Since we no longer prefix an "#include <stdint.h>" in the gssapi.h
preamble at build time, include it in gssapi.hin.

Update util/gss/kernel-lib/Makefile.in to account for gssapi_krb5.h
being in the source tree.

10 years agoIn kdb5_util dump, only lock DB for iprop dumps
Greg Hudson [Sun, 23 Feb 2014 16:28:44 +0000 (11:28 -0500)]
In kdb5_util dump, only lock DB for iprop dumps

Revert #7384, as there are no longer policy refcounts.  For iprop
dumps we want to make sure that the reported serial number matches the
DB state (although we could perhaps relax that requirement with enough
analysis), but for non-iprop dumps we don't need any transactional
guarantees.

Also use the correct constant name for the locking mode (the numeric
value is the same, fortunately), and only unlock the database if we
successfully locked it.

ticket: 7869 (new)

10 years agoEliminate internal fixed-width type wrappers
Greg Hudson [Sat, 1 Feb 2014 21:26:51 +0000 (16:26 -0500)]
Eliminate internal fixed-width type wrappers

Directly use stdint.h names for integer types in preference to the
various internal names we have made up for them.

10 years agoStop generating gssapi_krb5.h
Greg Hudson [Sat, 1 Feb 2014 20:59:21 +0000 (15:59 -0500)]
Stop generating gssapi_krb5.h

We started generating gssapi_krb5.h from gssapi_krb5.hin when we
needed to use a 64-bit type for lucid contexts.  Since we can now
assume a standard name for 64-bit types, we can stop generating the
header.

10 years agoGet rid of builtin AES uitypes.h
Greg Hudson [Sat, 1 Feb 2014 20:23:58 +0000 (15:23 -0500)]
Get rid of builtin AES uitypes.h

Remove uitypes.h and just include stdint.h; all we need from it is
uint{8,16,32}_t.

10 years agoAssume <stdint.h> and fixed-width types
Greg Hudson [Sat, 1 Feb 2014 20:20:08 +0000 (15:20 -0500)]
Assume <stdint.h> and fixed-width types

Make unconditional use of <stdint.h> and fixed-width types such as
uint32_t.  k5-plugin.h doesn't use any special integer types, so
remove the conditional include block there.  Nothing uses
INT64_FMT/UINT64_FMT, so leave those out of k5-platform.h for now.

10 years agoMinimize race conditions in t_iprop.py
Greg Hudson [Sat, 22 Feb 2014 20:58:03 +0000 (15:58 -0500)]
Minimize race conditions in t_iprop.py

Augment kpropd's debugging output so we can see the starting and
ending serial numbers of a sync, and check them in t_iprop.py's
wait_for_prop to make sure we're observing the correct sync each time.
Try to make sure we only send SIGUSR1 when kpropd is actually
sleeping, by waiting for it to print its pre-sleep message to stderr
after a full dump and after each sync.  This isn't perfect, as there
is a short window between printing to stderr and actually sleeping,
but we can't do any better until kpropd has a more reliable mechanism
for triggering immediate updates.

10 years agoAvoid duplicate "/etc/krb5.conf" in profile path
Tom Yu [Tue, 25 Feb 2014 22:35:35 +0000 (17:35 -0500)]
Avoid duplicate "/etc/krb5.conf" in profile path

If configure gets run with --sysconfdir=/etc, "/etc/krb5.conf" shows
up twice in the profile path, which causes its contents to be read
twice.  This can cause some confusing and possibly problematic
behavior.

Add some logic to configure.in to avoid adding the duplicate entry for
"/etc/krb5.conf".

Reported independently by Denis Vlasenko and Fredrik Tolf.

ticket: 3277
tags: pullup
target_version: 1.12.2

10 years agoUpdate kadmin set_string document
Zhanna Tsitkov [Mon, 24 Feb 2014 19:17:43 +0000 (14:17 -0500)]
Update kadmin set_string document

Added 'otp' as an acceptable attribute name.  Added examples.
Also, x-ref kadmin document from otp.rst.

10 years agoDocument hierarchical iprop
Greg Hudson [Tue, 28 Jan 2014 19:19:33 +0000 (14:19 -0500)]
Document hierarchical iprop

Also remove an outdated caveat, but add a new one about policy changes
causing full resyncs.

ticket: 7855

10 years agoTest iprop slave ulog management
Greg Hudson [Mon, 27 Jan 2014 17:50:12 +0000 (12:50 -0500)]
Test iprop slave ulog management

Check the ulog more thoroughly after each operation, including the
principal names we expect in each update entry.  Verify that the slave
ulog contains actual update entries received from master.  Add a
second slave which receives updates from the first.  Test a wider
variety of principal operations.  Add two additional operations after
the full resync to test that incremental updates resume after a full
resync (albeit with some lag).

ticket: 7855

10 years agoImplement kpropd -A
Greg Hudson [Mon, 27 Jan 2014 03:18:18 +0000 (22:18 -0500)]
Implement kpropd -A

The -A option causes kpropd to contact a specified admin server
(normally an intermediate slave running kadmind -proponly) instead of
the master admin server.

Based on code submitted by Richard Basch.

ticket: 7855

10 years agoImplement kadmind -proponly
Greg Hudson [Sun, 26 Jan 2014 23:11:56 +0000 (18:11 -0500)]
Implement kadmind -proponly

The -proponly option causes kadmind to only service the iprop service,
not the kpasswd or kadmin services.  An intermediate slave in a
hierarchical iprop setup runs kadmind -proponly in order to provide
incremental updates to downstream slaves.

Based on code submitted by Richard Basch.

ticket: 7855

10 years agoMaintain complete ulog on iprop slaves
Greg Hudson [Sat, 25 Jan 2014 19:40:41 +0000 (14:40 -0500)]
Maintain complete ulog on iprop slaves

Factor out most of ulog_add_update into a helper function named
store_update, and make ulog_add_update just responsible for assigning
a serial number and timestamp to the update before storing it.  In
ulog_replay, use store_update and ulog_finish_update to add each
update to the ulog in addition to replaying it to the database.  Don't
use incr_ret->lastentry to set kdb_last_sno/kdb_last_time, since it
will have been set properly by adding the individual updates; instead,
just reinitialize the ulog on error.

Slave ulogs use serial numbers provided from upstream, and thus do not
always begin at serial number 1 after a header reset.  As a result, we
must: (A) in store_update, detect the first update (for which we must
assign kdb_first_sno/kdb_first_time) by comparing kdb_num to 0,
instead of by comparing the serial number to 1; (B) in store_update,
detect that we are overwriting the first update by comparing kdb_num
to ulogentries, instead of comparing the serial number to ulogentries;
and (C) in ulog_map, detect that ulogentries changed by verifying the
first and last serial number and timestamp against the actual ulog
entries, rather than simply comparing kdb_last_sno to kdb_num.

Based on code submitted by Richard Basch.

ticket: 7855

10 years agoSimplify ulog_map
Greg Hudson [Fri, 24 Jan 2014 21:52:47 +0000 (16:52 -0500)]
Simplify ulog_map

Get rid of the caller parameter.  The kproplog semantics (without -R)
for mapping the ulog are simple and almost completely different from
other users of the ulog, so implement them as a static helper in
kproplog.  With hierarchical iprop, kpropd will need the same
semantics as FKCOMMAND and FKADMIND, which were already identical.

Get rid of the db_args parameter, since ulog_map no longer opens the
database after #7552.

Remove an inoperative lseek() call when creating a new ulog file.
Rename ulog_filesize to filesize and compute it from scratch each time
we use it, for easier analysis.  If kdb_hmagic is zero, init the ulog
header but don't skip the rest of the function; it's possible that we
need to expand the ulog file.  Remove an unneeded conditional before
calling extend_file_to for an existing ulog.

ticket: 7855

10 years agoLock around more ulog operations
Greg Hudson [Thu, 23 Jan 2014 16:34:52 +0000 (11:34 -0500)]
Lock around more ulog operations

Always lock the ulog when accessing it.  We can currently get away
with some laxness on iprop slaves because they are mostly synchronous,
but hierarchical iprop will allow master and slave operations to take
place concurrently, requiring more strict locking.

Add new functions ulog_get_last and ulog_set_last, which access the
ulog header with locking, and use them in kdb5_util and kpropd.  Add
locking to ulog_replay and ulog_init_header.

ulog_lock and ulog_sync_header are no longer used outside of kdb_log.c
after these changes, so make them static functions and remove the
ulog_ prefix.  Add an unlock_ulog function for clarity.

10 years agoFactor out ulog serial number status check
Greg Hudson [Mon, 20 Jan 2014 23:46:52 +0000 (18:46 -0500)]
Factor out ulog serial number status check

Add a new function ulog_get_sno_status, which checks a serial number
and timestamp against the ulog for currency.  Use it in kdb5_util dump
and in ulog_get_entries.  Adjust parse_iprop_header's contract in
dump.c to better match the ulog_get_sno_status contract.

This change causes some minor behavior differences.  kadmind will
check for an empty ulog unless the last serial number matches exactly,
and will never set lastentry when returning UPDATE_FULL_RESYNC_NEEDED
(which was pointless).  kdb5_util dump will recognize a dump file as
current if it exactly matches the last serial number, even if the ulog
is empty; it will be more robust in the presence of non-monotonic
clocks; and it will properly lock around the ulog access.

10 years agoSimplify iprop update locking and avoid deadlock
Greg Hudson [Thu, 13 Feb 2014 00:13:43 +0000 (19:13 -0500)]
Simplify iprop update locking and avoid deadlock

Since we are no longer treating the update log like a journal (#7552),
we don't need two-stage update logging.  In kdb5.c, add an update log
entry after each DB change in one step, without getting an explicit
lock.  In kdb_log.c, combine ulog_add_update with ulog_finish_update,
and make ulog_add_update lock the ulog internally.

This change avoids deadlock by removing the only cases where the ulog
is locked before the DB.

ticket: 7861

10 years agoUse system dictionary for db2 tests again
Greg Hudson [Tue, 18 Feb 2014 06:14:01 +0000 (01:14 -0500)]
Use system dictionary for db2 tests again

The built-in word list is not long enough for all of the libdb2 tests
to run properly.  Revert d21a86e47a7cda29225013e08d060095b94b2ee7 and
go back to using the system dictionary if we find one.  However, omit
any lines from the chosen word list which contain non-alphabetical
characters.

ticket: 7860

10 years agoUse TAILQ macros instead of CIRCLEQ in libdb2
Greg Hudson [Mon, 17 Feb 2014 05:18:41 +0000 (00:18 -0500)]
Use TAILQ macros instead of CIRCLEQ in libdb2

The optimizer in gcc 4.8.1 (but not the current gcc head revision)
breaks the queue.h CIRCLEQ macros, apparently due to an overzealous
strict aliasing deduction.  Use TAILQ macros in the libdb2 mpool code
instead.

ticket: 7860

10 years agoDocument 1.12 changes in MIT Kerberos Features doc
Zhanna Tsitkov [Fri, 14 Feb 2014 21:17:47 +0000 (16:17 -0500)]
Document 1.12 changes in MIT Kerberos Features doc

ticket: 7857

10 years agoMake KDC "status" statements more homogeneous
Zhanna Tsitkov [Mon, 23 Dec 2013 14:23:54 +0000 (09:23 -0500)]
Make KDC "status" statements more homogeneous

Generally we want KDC status strings to be concise, informative and follow
some common rules:

- All letters in the status string should be capitalized;
- the words in the status phrase are separated by underscore;
- abbreviations should be avoided.  Some acceptable "standard" acronyms
  are AS_REQ, TGS_REP etc.
- since in almost all cases KDC status is set on error, no need
  to state this fact as part of the status string;
- KDC status string should be an imperative phrase.

For example, "DECRYPT_SERVER_KEY".

This commit is to modify some KDC status messages to follow this format.

Even though KDC status messages are not standardized, it is possible that some
administrators use them in the Kerberos log file processing. Hence, the vast
majority of them are left unchanged pending further investigation (mostly,
feedback from the administrators).

10 years agoSupport referrals from Windows Server 2003
Nate Rosenblum [Mon, 23 Dec 2013 21:21:44 +0000 (13:21 -0800)]
Support referrals from Windows Server 2003

Although RFC 6806 Section 7 requires servers to indicate a client
referral in a WRONG_REALM message, Microsoft Windows Server 2003
returns this information in a message with error code
PRINCIPAL_UNKNOWN.  Failure to follow the referral in these messages
prevents referral chasing in Windows Server 2003 forests.  Detect
referral messages of this type by checking for a non-empty
client.realm field in the response, and activate the referral logic in
these cases.

[tlyu@mit.edu: style, comments, and commit message]

ticket: 7856 (new)
target_version: 1.12.2
tags: pullup

10 years agoUpdate doc build instructions
Tom Yu [Fri, 14 Feb 2014 20:59:51 +0000 (15:59 -0500)]
Update doc build instructions

Documentation build instructions in doc/README were out of date.
Update them.

ticket: 7864 (new)
tags: pullup
target_version: 1.12.2

10 years agoGenerate dependencies for t_stringattr
Greg Hudson [Wed, 12 Feb 2014 04:19:36 +0000 (23:19 -0500)]
Generate dependencies for t_stringattr

When t_stringattr.c was introduced, it wasn't added to EXTRADEPSRCS,
so no dependencies were created for it.  Fix that now.

10 years agoDon't use system dictionary files for DB2 tests
Greg Hudson [Wed, 12 Feb 2014 03:16:56 +0000 (22:16 -0500)]
Don't use system dictionary files for DB2 tests

The system dictionary may contain entries with punctuation, which can
confuse the shell.  It's more predictable to always use the word list
from the source tree.

ticket: 7860
status: open

10 years agoFix SAM-2 preauth when password argument is used
Greg Hudson [Wed, 12 Feb 2014 01:00:51 +0000 (20:00 -0500)]
Fix SAM-2 preauth when password argument is used

sam2_process accesses gak_data to get the password, so that it can do
string-to-key with the etype in the SAM-2 challenge.  When #7642
changed gic_pwd.c to use struct gak_password instead of krb5_data,
sam2_process wasn't altered to match.  We don't see a problem when the
password is read through the prompter (as with kinit), because the
password winds up in the storage field at the beginning of the
gak_password structure.  But when a password is supplied as a
parameter (as with ksu), the storage field is empty and we get the
wrong answer from sam2_process.

ticket: 7862
target_version: 1.12.2
tags: pullup

10 years agoCorrectly get default realm in kdb5.c
Greg Hudson [Mon, 10 Feb 2014 20:26:34 +0000 (15:26 -0500)]
Correctly get default realm in kdb5.c

Call krb5_get_default_realm instead of directly accessing
context->default_realm, to remove the requirement that
krb5_get_default_realm or krb5_set_default_realm be used before
krb5_db_open.

10 years agoMove OTP sockets to KDC_RUN_DIR
Nathaniel McCallum [Wed, 5 Feb 2014 15:59:46 +0000 (10:59 -0500)]
Move OTP sockets to KDC_RUN_DIR

Some system configurations expect Unix-domain sockets to live under
/run or /var/run, and not other parts of /var where persistent
application state lives.  Define a new directory KDC_RUN_DIR using
$runstatedir (new in autoconf 2.70, so fall back to $localstatedir/run
if it's not set) and use that for the default socket path.

[ghudson@mit.edu: commit message, otp.rst formatting fix]

ticket: 7859 (new)

10 years agoTest SPNEGO acceptor response to MS krb5 mech OID
Greg Hudson [Tue, 4 Feb 2014 01:59:54 +0000 (20:59 -0500)]
Test SPNEGO acceptor response to MS krb5 mech OID

In t_spnego.c, add code to make a SPNEGO request with the erroneous
Microsoft OID value and examine the response to make sure that it uses
the same OID value as the request did.  The token and tmp variables
were unused, so rename them to itok and atok for the purpose of the
new test code.

ticket: 7858
target_version: 1.12.2
tags: pullup

10 years agoProperly reflect MS krb5 mech in SPNEGO acceptor
Greg Hudson [Tue, 4 Feb 2014 02:11:34 +0000 (21:11 -0500)]
Properly reflect MS krb5 mech in SPNEGO acceptor

r25590 changed negotiate_mech() to return an alias into the acceptor's
mech set, with the unfortunate side effect of transforming the
erroneous Microsoft krb5 mech OID into the correct krb5 mech OID,
meaning that we answer with a different OID than the requested one.
Return an alias into the initiator's mech set instead, and store that
in mech_set field the SPNEGO context.  The acceptor code only uses
mech_set to hold the allocated storage pointed into by internal_mech,
so this change is safe.

ticket: 7858
target_version: 1.12.2
tags: pullup

10 years agoDon't get KDB lock in ulog_get_entries
Greg Hudson [Thu, 30 Jan 2014 17:37:46 +0000 (12:37 -0500)]
Don't get KDB lock in ulog_get_entries

ulog_get_entries does not access the KDB, only the ulog, so it does
not need a KDB lock; its read lock on the ulog is sufficient to
prevent logged updates from happening while it is running.  There is
no reason to serialize against unlogged KDB updates such as those
performed by the KDC, as those do not affect the ulog.

10 years agoIn kdb5_util load, init ulog closer to promote
Greg Hudson [Thu, 23 Jan 2014 15:51:21 +0000 (10:51 -0500)]
In kdb5_util load, init ulog closer to promote

Always map the ulog with FKCOMMAND, not FKLOAD which reinitializes the
ulog.  Don't reinitialize the ulog until just before calling
krb5_db_promote().  Get rid of FKLOAD since it isn't needed any more;
we can just call ulog_init_header() manually.

10 years agoClean up ovsec_kadmd.c
Greg Hudson [Sun, 26 Jan 2014 21:42:50 +0000 (16:42 -0500)]
Clean up ovsec_kadmd.c

Fix code formatting issues.  Use static scope when possible, and put
all helper functions before main so that forward declarations aren't
needed.  Use GSS_KRB5_NT_PRINCIPAL_NAME instead of constructing it
with gss_str_to_oid, and get rid of display_status as that was the
only use.  Replace large verbose function comments with concise ones.
Factor out main loop setup and KDB keytab setup into helper functions.
Create a helper function fail_to_start for logging and exiting on
initialization failures, and use it instead of the large cleanup
blocks in main.

Some initialization error messages have changed; no other functional
changes.

10 years agoModernize iprop code
Greg Hudson [Thu, 23 Jan 2014 23:15:24 +0000 (18:15 -0500)]
Modernize iprop code

* Don't use "extern" for kdb_log.h prototypes.
* Avoid passing structures by value.
* Avoid the need to cast the result of the INDEX macro, and use char *
  instead of unsigned long for pointer arithmetic.
* Reorganize kdb_log.c so static helpers are at the top and don't use
  the "ulog_" prefix.
* Get rid of ulog_finish_update_slave since it's more concise to
  open-code it in ulog_replay.
* Get rid of ulog_delete_update.  In krb5_db_delete_principal, just
  call ulog_add_update with kdb_deleted set in upd.
* Modernize coding style of kproplog.c.  Use k5memdup0 instead of
  snprintf in print_str to convert a byte range to a C string.
  Remove an unnecesary textdomain call; libkrb5 takes care of calling
  bindtextdomain in the library initializer.
* Modernize coding style of kpropd.c and kprop.c.

No functional changes.

10 years agoFix kpropd -x
Greg Hudson [Sun, 26 Jan 2014 23:38:11 +0000 (18:38 -0500)]
Fix kpropd -x

A missing break in the switch statement caused kpropd -x to error out
with a usage message.

ticket: 7854 (new)
target_version: 1.12.2
tags: pullup

10 years agoRemove kdb5_util load iprop safety net
Greg Hudson [Fri, 24 Jan 2014 04:49:34 +0000 (23:49 -0500)]
Remove kdb5_util load iprop safety net

Revert the safety net added #7370.  As written it only applied to the
master KDC, where a normal load sometimes makes sense.  Even on a
slave, there are edge cases where it can make sense to do a normal
load.

ticket: 7850 (new)

10 years agoCheck for unstable ulog in ulog_get_entries
Greg Hudson [Sun, 26 Jan 2014 22:23:53 +0000 (17:23 -0500)]
Check for unstable ulog in ulog_get_entries

If a process terminates in the middle of a logged database update, it
will release its lock and leave the ulog in the KDB_UNSTABLE state.
kadmind should notice this when it calls ulog_get_entries, but right
now it only checks for the KDB_CORRUPT state (which is never set any
more) and does not recover.  Check for any state other than KDB_STABLE
and recover by resetting the ulog and forcing full resyncs to slaves.

ticket: 7853 (new)
target_version: 1.12.2
tags: pullup

10 years agoAdd test case for ulog serial number wrapping
Greg Hudson [Thu, 30 Jan 2014 17:26:09 +0000 (12:26 -0500)]
Add test case for ulog serial number wrapping

Add a unit test program named t_ulog.  Make it map a ulog file, set up
header state where kdb_last_sno is the last serial number, and then
add an empty update.  Check that the result is a ulog header with one
update at serial number 1.

ticket: 7839

10 years agoReinitialize ulog when wrapping serial number
Greg Hudson [Tue, 21 Jan 2014 15:58:04 +0000 (10:58 -0500)]
Reinitialize ulog when wrapping serial number

When we wrap the serial number, reinitialize the ulog so that kdb_num
starts counting from 1, instead of leaving the ulog in a weird state
where kdb_num == ulogentries but kdb_last_sno == 1 and the serial
numbers in the circular array aren't necessarily contiguous.

ticket: 7839 (new)
target_version: 1.12.2
tags: pullup

10 years agoRemove krb5-send-pr
Tom Yu [Wed, 22 Jan 2014 22:38:32 +0000 (17:38 -0500)]
Remove krb5-send-pr

Remove the GNATS-based krb5-send-pr script and replace it with a
script that instructs users to send email.

ticket: 7840 (new)

10 years agoAdd test coverage for gss_pseudo_random
Greg Hudson [Sat, 18 Jan 2014 18:25:56 +0000 (13:25 -0500)]
Add test coverage for gss_pseudo_random

Add a test program which compares gss_pseudo_random outputs against
expected values for each enctype.

10 years agoFix gss_pseudo_random leak on zero length output
Greg Hudson [Sat, 18 Jan 2014 18:03:32 +0000 (13:03 -0500)]
Fix gss_pseudo_random leak on zero length output

Nobody is likely to ever ask for zero bytes of output from
gss_pseudo_random, but if they do, just return an empty buffer without
allocating.  Otherwise we leak memory because gss_release_buffer
doesn't do anything to buffers with length 0.

ticket: 7838 (new)

10 years agoAdd test for gss_acquire_cred_from rcache feature
Greg Hudson [Thu, 16 Jan 2014 16:49:55 +0000 (11:49 -0500)]
Add test for gss_acquire_cred_from rcache feature

10 years agoAllow empty store in gss_acquire_cred_from
Greg Hudson [Thu, 16 Jan 2014 16:49:04 +0000 (11:49 -0500)]
Allow empty store in gss_acquire_cred_from

There is no reason to deny a zero-length cred store, so don't check
for it in val_acq_cred_args or val_add_cred_args.

ticket: 7836 (new)
target_version: 1.12.2
tags: pullup

10 years agoAvoid assertion failure in error_message
Greg Hudson [Thu, 16 Jan 2014 16:32:10 +0000 (11:32 -0500)]
Avoid assertion failure in error_message

r17942 added a call to get_thread_buffer in the first part of
error_message, prior to the call to com_err_initialize.  This can
cause an assertion failure from k5_getspecific if error_message is
called on a system error before any other com_err functions are
called.  Move the initialization call earlier to prevent this.

ticket: 7822 (new)
target_version: 1.12.2
tags: pullup

10 years agoAdd rcache feature to gss_acquire_cred_from
Simo Sorce [Fri, 27 Dec 2013 00:05:34 +0000 (19:05 -0500)]
Add rcache feature to gss_acquire_cred_from

The "rcache" cred store entry can specify a replay cache type and name
to be used with the credentials being acquired.

[ghudson@mit.edu: split up, simplified, and altered to fit preparatory
commits]

ticket: 7819 (new)

10 years agoClean up rcache if GSS krb5 acquire_cred fails
Greg Hudson [Wed, 15 Jan 2014 19:41:54 +0000 (14:41 -0500)]
Clean up rcache if GSS krb5 acquire_cred fails

The error handler in acquire_cred_context didn't release the rcache,
which would cause it to leak if we failed after acquire_accept_cred.

ticket: 7818 (new)
target_version: 1.12.2
tags: pullup

10 years agoClean up GSS krb5 acquire_accept_cred
Greg Hudson [Wed, 15 Jan 2014 17:51:42 +0000 (12:51 -0500)]
Clean up GSS krb5 acquire_accept_cred

Use a cleanup handler instead of releasing kt in multiple error
clauses.  Wrap a long line and fix a comment with a missing word.
Rewrap the function arguments to use fewer lines.

10 years agoMake rcache resolve functions take const char *
Greg Hudson [Wed, 15 Jan 2014 17:31:41 +0000 (12:31 -0500)]
Make rcache resolve functions take const char *

10 years agoUpdate copyright years and acknowledgments
Tom Yu [Fri, 17 Jan 2014 18:58:19 +0000 (13:58 -0500)]
Update copyright years and acknowledgments

10 years agoGet time offsets for all keyring ccaches
Greg Hudson [Thu, 16 Jan 2014 22:48:54 +0000 (17:48 -0500)]
Get time offsets for all keyring ccaches

Move the time offset lookup from krb5_krcc_resolve to make_cache, so
that we fetch time offsets for caches created by
krb5_krcc_ptcursor_next.

ticket: 7820
target_version: 1.12.2
tags: pullup

10 years agoUpdate copyright years
Tom Yu [Thu, 16 Jan 2014 01:42:08 +0000 (20:42 -0500)]
Update copyright years

10 years agomake update-po
Tom Yu [Wed, 15 Jan 2014 23:54:40 +0000 (18:54 -0500)]
make update-po

10 years agoSort file list for msgfmt
Tom Yu [Wed, 15 Jan 2014 23:40:57 +0000 (18:40 -0500)]
Sort file list for msgfmt

The list of input files for msgfmt was unsorted find output, resulting
in excessively large changes when running "make update-po".

ticket: 7821 (new)
target_version: 1.12.1
tags: pullup

10 years agoRemove mentions of krb5-send-pr
Tom Yu [Tue, 14 Jan 2014 20:43:35 +0000 (15:43 -0500)]
Remove mentions of krb5-send-pr

Start the process of deprecating krb5-send-pr.  In practice, it causes
frustration for some users, and free-form email is good enough for
most bug reports.

Continue to install krb5-send-pr for now, but plan to remove it from
the tree in the future, probably replaced by a script that instructs
the user to send email manually.

ticket: 5566
target_version: 1.12.1
tags: pullup

10 years agoFix typo in sphinx manpage output
Tom Yu [Tue, 14 Jan 2014 21:13:44 +0000 (16:13 -0500)]
Fix typo in sphinx manpage output

Some versions of the sphinx manpage writer have a typo in the name
'reStructuredText' written into the comments.  Add a sed command to
fix this.

ticket: 7817 (new)
target_version: 1.12.1
tags: pullup