]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
12 years agoFix a trivial file leak writing kadmind pid file
Greg Hudson [Mon, 25 Mar 2013 21:38:41 +0000 (17:38 -0400)] 
Fix a trivial file leak writing kadmind pid file

If we fail to write the pid to the pid file, we should still close the
file before returning from write_pid_file().  The consequences of this
bug are trivial because kadmin is just going to exit regardless.
Reported by Will Fiveash <will.fiveash@oracle.com>.

12 years agoExport verto_set_flags from libverto
Greg Hudson [Mon, 25 Mar 2013 16:42:49 +0000 (12:42 -0400)] 
Export verto_set_flags from libverto

When the bundled libverto was updated from 0.2.2 to 0.2.5,
verto_set_flags should have been added to libverto.exports along with
the other new functions.

ticket: 7594 (new)
target_version: 1.11.2
tags: pullup

12 years agoReplace "First introduced" with concise "New"
Zhanna Tsitkov [Mon, 25 Mar 2013 19:18:53 +0000 (15:18 -0400)] 
Replace "First introduced" with concise "New"

12 years agoFix import_sec_context with interposers
Simo Sorce [Sat, 16 Mar 2013 19:23:03 +0000 (15:23 -0400)] 
Fix import_sec_context with interposers

The code was correctly selecting the mechanism to execute, but it was
improperly setting the mechanism type of the internal context when the
selected mechanism was that of an interposer and vice versa.

When an interposer is involved the internal context is that of the
interposer, so the mechanism type of the context needs to be the
interposer oid.  Conversely, when an interposer re-enters gssapi and
presents a token with a special oid, the mechanism called is the real
mechanism, and the context returned is a real mechanism context.  In
this case the mechanism type of the context needs to be that of the
real mechanism.

ticket: 7592
target_version: 1.11.2
tags: pullup

12 years agomake depend
Greg Hudson [Sun, 24 Mar 2013 05:30:33 +0000 (01:30 -0400)] 
make depend

12 years agoMove a bunch of stuff out of k5-int.h
Greg Hudson [Sun, 24 Mar 2013 05:28:13 +0000 (01:28 -0400)] 
Move a bunch of stuff out of k5-int.h

Move internal declarations from k5-int.h to more localized headers
(like int-proto.h) where appropriate.  Rename many symbols whose
prototypes were moved to use the k5_ prefix instead of krb5int_.
Remove some unused declarations or move them to the single source file
they were needed in.  Remove krb5_creds_compare since it isn't used
any more.

12 years agoGet rid of krb5_{get,free}_krbhst
Greg Hudson [Fri, 22 Mar 2013 20:00:48 +0000 (16:00 -0400)] 
Get rid of krb5_{get,free}_krbhst

These functions were always internal.  They haven't been used since
v5passwdd was eliminated in krb5 1.4.

12 years agoGet rid of osconfig.c
Greg Hudson [Fri, 22 Mar 2013 16:59:48 +0000 (12:59 -0400)] 
Get rid of osconfig.c

These variables were marked as internal in 1996.  Two are unused and
the other is easily replaced with the macro it is initialized from.

12 years agoRebuild NOTICE for 2013
Ben Kaduk [Thu, 21 Mar 2013 15:49:49 +0000 (11:49 -0400)] 
Rebuild NOTICE for 2013

Also exclude copyright.rst from the notice.txt build, as maintainer-mode
builds error out due to the "document isn't included in any toctree"
warning otherwise produced.

12 years agoClean up getclhoststr in ipropd_svc.c
Greg Hudson [Thu, 21 Mar 2013 05:48:22 +0000 (01:48 -0400)] 
Clean up getclhoststr in ipropd_svc.c

Based on a patch from Xi Wang <xi@mit.edu>.

12 years agoDocumentation Copyrights notice dates: 1985-2013
Zhanna Tsitkov [Wed, 20 Mar 2013 18:47:05 +0000 (14:47 -0400)] 
Documentation Copyrights notice dates: 1985-2013

12 years agoUpdate shlib.conf for FreeBSD
Ben Kaduk [Tue, 12 Mar 2013 02:57:06 +0000 (22:57 -0400)] 
Update shlib.conf for FreeBSD

FreeBSD has not emitted a.out binaries by default for a very long
time; elf is the standard.

Take sparc64 conditional for PICFLAGS from downstream.

Enable "new" dtags (supported since FreeBSD 5.0) -- this
prevents rpath entries in libraries from taking precedence over
LD_LIBRARY_PATH, useful for testing.

12 years agoReset ulog header if iprop load fails
Greg Hudson [Fri, 15 Mar 2013 17:03:26 +0000 (13:03 -0400)] 
Reset ulog header if iprop load fails

If an iprop slave tries to load a dump from the master and it fails,
reset the ulog header so we take another full dump, instead of
reporting that the slave is current when it isn't.  Reported by
Richard Basch <basch@alum.mit.edu>.

ticket: 7588
target_version: 1.11.2
tags: pullup

12 years agoAdd PEM password prompter callback in PKINIT
Nalin Dahyabhai [Fri, 15 Mar 2013 16:05:56 +0000 (12:05 -0400)] 
Add PEM password prompter callback in PKINIT

Supply a callack to PEM_read_bio_PrivateKey() using the prompter to
request a password for encrypted PEM data.  Otherwise OpenSSL will use
the controlling terminal.

[ghudson@mit.edu: minor style cleanup, commit message]

ticket: 7590

12 years agoEliminate unused variables
Greg Hudson [Fri, 15 Mar 2013 06:22:42 +0000 (02:22 -0400)] 
Eliminate unused variables

12 years agoFix argument type in kg_unseal_v1
Greg Hudson [Fri, 15 Mar 2013 06:16:39 +0000 (02:16 -0400)] 
Fix argument type in kg_unseal_v1

The caller of kg_unseal_v1 passes a gss_qop_t * for the qop_state
parameter, so make it use that type instead of an int *.  Noted by
David Benjamin <davidben@mit.edu>.

12 years agoFix kadmin_getpol format string
Greg Hudson [Fri, 15 Mar 2013 06:13:22 +0000 (02:13 -0400)] 
Fix kadmin_getpol format string

Commit 0780e46fc13dbafa177525164997cd204cc50b51 matched a %ld format
string with the integer 0, which is an int rather than a long.  Just
put 0 in the format string instead.  Noted by David Benjamin
<davidben@mit.edu>.

12 years agoFix condition with empty body
David Benjamin [Wed, 13 Mar 2013 05:08:01 +0000 (01:08 -0400)] 
Fix condition with empty body

Found by clang's warnings.

ticket: 7591 (new)
target_version: 1.11.2
tags: pullup

12 years agoAllocate space for NUL byte in test code
David Benjamin [Wed, 13 Mar 2013 05:07:32 +0000 (01:07 -0400)] 
Allocate space for NUL byte in test code

Caught by ASan.

12 years agoFix use-before-init in two test programs
Greg Hudson [Fri, 15 Mar 2013 05:57:40 +0000 (01:57 -0400)] 
Fix use-before-init in two test programs

If krb5_init_context fails, use a null context for getting the error
message, not a context we haven't yet initialized.  Observed by David
Benjamin <davidben@mit.edu> using clang.

12 years agoInitialize status in krb5_ldap_parse_db_params
Greg Hudson [Mon, 11 Mar 2013 20:09:06 +0000 (16:09 -0400)] 
Initialize status in krb5_ldap_parse_db_params

If db_args is non-null but empty, status could be returned without
being initialized; gcc with optimization correctly warns about this,
causing a build failure.  (This bug was introduced by
0b1dc2f93da4c860dd27f1ac997617b712dff383 which was pushed after the
1.11 release branch, so it isn't in any release.)

12 years agoAdd support for k5srvutil -e keysalts
Alex Dehnert [Sat, 9 Mar 2013 04:48:33 +0000 (23:48 -0500)] 
Add support for k5srvutil -e keysalts

k5srvutil is a little more convenient to use for rolling keys than
kadmin is.  When migrating off 1DES, though, it may be desirable to
explicitly specify the desired keysalts.  This adds an option, -e, to
k5srvutil to specify desired keysalts.

[ghudson@mit.edu: style fix; make whitespace in keysalt list work]

ticket: 7589 (new)

12 years agoRemove stray include in localauth_plugin.h
Greg Hudson [Mon, 11 Mar 2013 17:48:13 +0000 (13:48 -0400)] 
Remove stray include in localauth_plugin.h

This unnecessary include was causing build failures on some systems by
making libkrb5 sources depend on gssapi.h.

12 years agoDocument localauth interface
Greg Hudson [Fri, 1 Mar 2013 18:12:19 +0000 (13:12 -0500)] 
Document localauth interface

ticket: 7583

12 years agoAdd tests for localauth interface
Greg Hudson [Wed, 27 Feb 2013 20:00:37 +0000 (15:00 -0500)] 
Add tests for localauth interface

Create a test module, program, and script to exercise the
krb5_aname_to_localname and krb5_k5userok functions as well as the
localauth pluggable interface.

ticket: 7583

12 years agoAdd localauth pluggable interface
Greg Hudson [Wed, 13 Feb 2013 20:29:48 +0000 (15:29 -0500)] 
Add localauth pluggable interface

Add a new pluggable interface for local authorization, and replace the
existing krb5_aname_to_localname and krb5_kuserok implementations with
implementations based on the pluggable interface.

ticket: 7583 (new)

12 years agoFix dependencies in tests/gssapi
Nickolai Zeldovich [Sun, 3 Mar 2013 06:38:22 +0000 (01:38 -0500)] 
Fix dependencies in tests/gssapi

Use $(COMMON_DEPS) instead of $(COMMON_DEPLIBS) for dependencies; the
latter appears to be a typo.  Fixes build when using "make -j".

ticket: 7587 (new)
target_version: 1.11.2
tags: pullup

12 years agoSimplify and clarify lookup_etypes_for_keytab
Greg Hudson [Thu, 28 Feb 2013 23:56:45 +0000 (18:56 -0500)] 
Simplify and clarify lookup_etypes_for_keytab

12 years agoFix a memory leak in krb5_get_init_creds_keytab
Greg Hudson [Thu, 28 Feb 2013 23:55:31 +0000 (18:55 -0500)] 
Fix a memory leak in krb5_get_init_creds_keytab

lookup_etypes_for_keytab was not freeing the keytab entries it
iterated over.  Reported by nalin@redhat.com.

ticket: 7586
target_version: 1.11.2
tags: pullup

12 years agoAdd krb5_free_enctypes API
Greg Hudson [Wed, 27 Feb 2013 22:29:16 +0000 (17:29 -0500)] 
Add krb5_free_enctypes API

Rename krb5_free_ktypes to krb5_free_enctypes and add it to the public
API.

ticket: 7584

12 years agoAdd missing .gitignore entries and clean rules
Greg Hudson [Wed, 27 Feb 2013 21:33:28 +0000 (16:33 -0500)] 
Add missing .gitignore entries and clean rules

ticket: 7585

12 years agoFix windows build
Ben Kaduk [Mon, 25 Feb 2013 18:12:33 +0000 (13:12 -0500)] 
Fix windows build

Catch up to the split of preauth_plugin.h into client and
kdc specific portions.  While here, use copy's /y flag to suppress
an override-confirmation prompt (though we do not list any dependencies
for this target at the moment, so no such prompt will be generated).

Do not disable library finalizers for windows, erroneously disabled
in 4538146e1452e0966164119cefb0804993ce6bbb.

12 years agoUpdate acknowledgments in README
Tom Yu [Thu, 21 Feb 2013 19:38:58 +0000 (14:38 -0500)] 
Update acknowledgments in README

Also update copyright years.

12 years agoFix fd leak in DIR ccache cursor function
Greg Hudson [Thu, 21 Feb 2013 17:36:07 +0000 (12:36 -0500)] 
Fix fd leak in DIR ccache cursor function

If dcc_ptcursor_next reached the end of a directory, it called free()
on the directory handle instead of closedir(), causing the directory
fd to be leaked.  Call closedir() instead.

ticket: 7573
target_version: 1.11.1
tags: pullup

12 years agoFix memory leak closing DIR ccaches
Greg Hudson [Wed, 20 Feb 2013 17:06:12 +0000 (12:06 -0500)] 
Fix memory leak closing DIR ccaches

A ccache type's close function is supposed to free the cache container
as well as the type-specific data.  dcc_close was not doing so,
causing a small memory leak each time a ccache is created or
destroyed.

ticket: 7574 (new)
target_version: 1.11.1
tags: pullup

12 years agoAllow multi-hop SAM-2 exchanges
Greg Hudson [Sun, 17 Feb 2013 17:44:45 +0000 (12:44 -0500)] 
Allow multi-hop SAM-2 exchanges

Prior to 1.11, it was possible to do SAM-2 preauth exchanges with
multiple hops by sending repeated preauth-required errors with
different challenges (which is not the way multi-hop exchanges are
described in RFC 6113, but it can still work).  This stopped working
when SAM-2 was converted to a built-in module.  Make it work again.

ticket: 7571 (new)
target_version: 1.11.1
tags: pullup

12 years agoCleaner fix for #7570
Ben Kaduk [Fri, 15 Feb 2013 16:41:27 +0000 (11:41 -0500)] 
Cleaner fix for #7570

Remove variables and labels which are no longer needed.

12 years agoPKINIT null pointer deref [CVE-2013-1415]
Xi Wang [Thu, 14 Feb 2013 23:17:40 +0000 (18:17 -0500)] 
PKINIT null pointer deref [CVE-2013-1415]

Don't dereference a null pointer when cleaning up.

The KDC plugin for PKINIT can dereference a null pointer when a
malformed packet causes processing to terminate early, leading to
a crash of the KDC process.  An attacker would need to have a valid
PKINIT certificate or have observed a successful PKINIT authentication,
or an unauthenticated attacker could execute the attack if anonymous
PKINIT is enabled.

CVSSv2 vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:P/RL:O/RC:C

This is a minimal commit for pullup; style fixes in a followup.
[kaduk@mit.edu: reformat and edit commit message]

ticket: 7570 (new)
target_version: 1.11.1
tags: pullup

12 years agoConvert success in krb5_chpw_result_code_string
Jonathan Reams [Fri, 15 Feb 2013 07:11:57 +0000 (02:11 -0500)] 
Convert success in krb5_chpw_result_code_string

Result code 0 used to be converted properly by krb5_set_password,
though not krb5_change_password; this changed in 1.10 when
krb5int_setpw_result_code_string was folded into
krb5_chpw_result_code_string.  Restore the old behavior, and make it
apply to krb5_change_password as well, by making
krb5_chpw_result_code_string convert result code 0.

[ghudson@mit.edu: commit message]

ticket: 7569 (new)
target_version: 1.11.1
tags: pullup

12 years agoModernize k5buf
Greg Hudson [Thu, 14 Feb 2013 16:41:10 +0000 (11:41 -0500)] 
Modernize k5buf

Rename the krb5int_buf_ family of functions to use the k5_ prefix for
brevity.  Reformat some k5buf implementation code to match current
practices.

12 years agoAdd k5_json_array_fmt and use it in export_cred.c
Greg Hudson [Tue, 12 Feb 2013 02:07:54 +0000 (21:07 -0500)] 
Add k5_json_array_fmt and use it in export_cred.c

Add a template-based array constructor for convenient marshalling of
structured values as JSON array values.  Use it to simplify
export_cred.c.

12 years agoMake internal JSON functions return error codes
Greg Hudson [Tue, 30 Oct 2012 21:17:45 +0000 (17:17 -0400)] 
Make internal JSON functions return error codes

Return error codes (0, ENOMEM, or EINVAL) from JSON support functions
instead of returning results directly.  This makes error handling
simpler for functions which assemble JSON objects and then return a
krb5_error_code values.  Adjust all callers.  Use shims in
export_cred.c to minimize changes there; it will be redesigned
internally in a subsequent commit.

12 years agoFix RFC 5587 const pointer typedefs
Greg Hudson [Tue, 12 Feb 2013 02:13:15 +0000 (21:13 -0500)] 
Fix RFC 5587 const pointer typedefs

gss_const_ctx_id_t, gss_const_cred_id_t, and gss_const_name_t are
supposed to be const pointers to the appropriate structures, not the
structures themselves.  These are not used by any prototypes yet, and
no application would have any reason to use them as they are, so it
should be safe to change them within the public header.

ticket: 7567 (new)
target_version: 1.11.1
tags: pullup

12 years agoAdd and use k5memdup, k5memdup0 helpers
Greg Hudson [Sat, 9 Feb 2013 05:43:35 +0000 (00:43 -0500)] 
Add and use k5memdup, k5memdup0 helpers

Add k5-int.h static functions to duplicate byte ranges, optionally
with a trailing zero byte, and set an error code like k5alloc does.
Use them where they would shorten existing code.

12 years agoSimplify TGS request construction
Greg Hudson [Fri, 8 Feb 2013 06:59:19 +0000 (01:59 -0500)] 
Simplify TGS request construction

Move krb5int_make_tgs_request from gc_via_tkt.c into send_tgs.c,
combine it with krb5int_make_tgs_request_ext (which nothing else
called), and rename the combined function to k5_make_tgs_req.  Also
use a typedef for the pacb callback.

12 years agoModernize send_tgs.c
Greg Hudson [Fri, 8 Feb 2013 05:18:50 +0000 (00:18 -0500)] 
Modernize send_tgs.c

Bring send_tgs.c up to date with current coding practices.  No
functional changes.

12 years agoReplace i_vector with cstate in auth context
Greg Hudson [Sun, 3 Feb 2013 19:44:22 +0000 (14:44 -0500)] 
Replace i_vector with cstate in auth context

Use a proper cipher state in the auth context structure, and free it
when the auth context is freed.  Simplify mk_priv/rd_priv accordingly.

12 years agoDesupport krb5_auth_con_setivector
Greg Hudson [Tue, 5 Feb 2013 17:43:53 +0000 (12:43 -0500)] 
Desupport krb5_auth_con_setivector

ticket: 7565 (new)

12 years agoAdd kprop Python tests
Greg Hudson [Sun, 3 Feb 2013 17:25:10 +0000 (12:25 -0500)] 
Add kprop Python tests

Create a K5Realm.kprop_port method so test scripts can invoke kprop
usefully, and create a simple Python test script exercising the same
kprop functionality as the dejagnu suite's kprop.exp.

12 years agoMake kprop/kpropd work with RC4 session key
Greg Hudson [Sun, 3 Feb 2013 18:21:34 +0000 (13:21 -0500)] 
Make kprop/kpropd work with RC4 session key

In krb5_auth_con_initivector and mk_priv/rd_priv, stop assuming that
the enctype's block size is the size of the cipher state.  Instead,
make and discard a cipher state to get the size.

ticket: 7561
target_version: 1.11.1
tags: pullup

12 years agoModernize dump.c
Greg Hudson [Tue, 5 Feb 2013 03:44:45 +0000 (22:44 -0500)] 
Modernize dump.c

Reformat and simplify dump.c code according to current coding
standards.  No functional changes except for some error messages.

12 years agoRefactor dump.c
Greg Hudson [Wed, 6 Feb 2013 19:49:09 +0000 (14:49 -0500)] 
Refactor dump.c

When dumping, use a common iterator function to unpack the dump_args
structure, unparse and filter the principal name, and convert master
keys.  Add helper functions to dump and load the "octets or -1" format
used for optional binary fields in the current dump format.

12 years agoReorder dump.c
Greg Hudson [Tue, 5 Feb 2013 05:31:23 +0000 (00:31 -0500)] 
Reorder dump.c

Without changing anything (except to make a few internal functions
static), reorder dump.c to bottom-up order so that forward function
declarations aren't needed.

12 years agoRemove -b6 and -old dump formats
Greg Hudson [Mon, 4 Feb 2013 23:43:22 +0000 (18:43 -0500)] 
Remove -b6 and -old dump formats

Get rid of the code to dump and load -b6 and -old format dump files.
Loading these versions hasn't worked since at least 1.3.

ticket: 7564 (new)

12 years agoAdd more tests for dump and load
Greg Hudson [Mon, 4 Feb 2013 23:21:45 +0000 (18:21 -0500)] 
Add more tests for dump and load

Move the existing dump/load tests from t_general.py to a new script
t_dump.py.  Add additional tests using pre-created dumpfiles, to
exercise the -r18, -r13, -b7, and -ov formats.

bigredbutton: whitespace

12 years agoSimplify kdb5_util create using a null password
Greg Hudson [Mon, 4 Feb 2013 19:01:40 +0000 (14:01 -0500)] 
Simplify kdb5_util create using a null password

kadm5_create_principal now uses a random key if passed a null
password, so we don't need a multi-step process to create admin
principals when creating a database any more.

12 years agoFix kdb5_util dump.c uninitialized warnings
Greg Hudson [Fri, 1 Feb 2013 16:52:48 +0000 (11:52 -0500)] 
Fix kdb5_util dump.c uninitialized warnings

Some versions of clang report an uninitialized variable warning (which
we treat as an error) in process_k5beta_record.  Due to the if-ladder
style of the function, uninitialized tmpint values can be copied
around in certain error cases, although the garbage values would be
ultimately ignored.  As a minimal fix, initialize the tmpint
variables.

ticket: 7560 (new)
target_version: 1.11.1
tags: pullup

12 years agoSimplify LDAP password decoding
Greg Hudson [Fri, 1 Feb 2013 07:14:45 +0000 (02:14 -0500)] 
Simplify LDAP password decoding

Make dec_password a static function in ldap_service_stash.c and remove
some impedance mismatch with krb5_ldap_readpassword() by making it
operate on C strings and return a krb5_error_code.

12 years agoRefactor rellinks formatting in layout.html
Tom Yu [Fri, 18 Jan 2013 20:45:52 +0000 (15:45 -0500)] 
Refactor rellinks formatting in layout.html

12 years agoReduce copied code in layout.html
Tom Yu [Fri, 18 Jan 2013 04:29:59 +0000 (23:29 -0500)] 
Reduce copied code in layout.html

layout.html unneccesarily copied code from the parent
agogo/layout.html content block just to alter the sidebar.  Override
various subblocks of the sidebar instead.

12 years agoConsolidate style settings in kerb.css
Tom Yu [Fri, 18 Jan 2013 03:58:46 +0000 (22:58 -0500)] 
Consolidate style settings in kerb.css

Move style settings that were previously in layout.html to kerb.css.
Rename kerb.css kerb.css_t, making it a template, to allow
parameterized style settings to remain parameterized.

12 years agoFix "search" accesskey in layout.html
Tom Yu [Fri, 18 Jan 2013 03:42:23 +0000 (22:42 -0500)] 
Fix "search" accesskey in layout.html

The accesskey for the "search" link conflicted with the one for the
"contents" link.

ticket: 7559 (new)
target_version: 1.11.1
tags: pullup

12 years agoFix typos in layout.html
Tom Yu [Fri, 18 Jan 2013 03:39:57 +0000 (22:39 -0500)] 
Fix typos in layout.html

There were multiple misplaced semicolons, etc.

ticket: 7558 (new)
target_version: 1.11.1
tags: pullup

12 years agoFix h1 end tag in Sphinx header titles
Tom Yu [Thu, 17 Jan 2013 22:56:53 +0000 (17:56 -0500)] 
Fix h1 end tag in Sphinx header titles

A </h1> end tag was incorrectly written as <h1>.  Also adjust style
settings so that the resulting computed style remains the same for
div.rel.

ticket: 7557 (new)
target_version: 1.11.1
tags: pullup

12 years agoRemove partial LDAP client cert support
Greg Hudson [Thu, 31 Jan 2013 18:40:36 +0000 (13:40 -0500)] 
Remove partial LDAP client cert support

The LDAP KDB module has some code to interpret {FILE} values in stash
files, and set the service_cert_path/pass fields in the ldap context.
But there was no code to actually use those values to do client cert
authentication, so it wasn't useful.  Remove the partial
implementation.

12 years agoNew section: Contributing to Kerb documentation
Zhanna Tsitkov [Thu, 31 Jan 2013 16:39:44 +0000 (11:39 -0500)] 
New section: Contributing to Kerb documentation

12 years agoFix COPY_FIRST_CANONNAME hostent search
Viktor Dukhovni [Thu, 31 Jan 2013 03:58:50 +0000 (22:58 -0500)] 
Fix COPY_FIRST_CANONNAME hostent search

In fake-addrinfo.c, the COPY_FIRST_CANONNAME logic erroneously assumes
that h_name is the same as h_aliases[0].  Look at h_name before
h_aliases for an FQDN, since h_name is normally the
forward-canonicalized name and h_aliases are not.

[ghudson@mit.edu: rewrote commit message]

ticket: 7556 (new)

12 years agoRevert previous change to process_tgs_req
Greg Hudson [Thu, 31 Jan 2013 07:15:59 +0000 (02:15 -0500)] 
Revert previous change to process_tgs_req

Commit c072b059ecff257e7600be0e86869decd135d422 did not have the
intended effect because, at the point where is_referral is set,
request->server has already been modified to contain server->princ.

ticket: 7555
status: open

12 years agoFix is_referral flag in KDC TGS code
Greg Hudson [Thu, 31 Jan 2013 06:26:22 +0000 (01:26 -0500)] 
Fix is_referral flag in KDC TGS code

A server response which is a cross-realm TGT is not a referral if it
was directly requested by the client.  Misclassifying such a response
as a referral means we don't mirror the request's name type, which has
been observed to break older Java clients.

ticket: 7555 (new)

12 years agoNote which release -x debug was added in
Greg Hudson [Tue, 29 Jan 2013 18:16:05 +0000 (13:16 -0500)] 
Note which release -x debug was added in

12 years agoFix prepend_err_str in LDAP KDB module
Greg Hudson [Tue, 29 Jan 2013 18:13:04 +0000 (13:13 -0500)] 
Fix prepend_err_str in LDAP KDB module

Use the oerr parameter to fetch the existing message.  Stop handling
oerr == 0, since no call sites were using it.  Free the old error
message before returning.

12 years agoAdd LDAP debug DB option
Greg Hudson [Tue, 29 Jan 2013 03:30:41 +0000 (22:30 -0500)] 
Add LDAP debug DB option

Add a DB option in the LDAP KDB module to turn on debugging messages.
Adapted from a patch by Zoran Pericic <zpericic@inet.hr>.

ticket: 7551 (new)

12 years agoRefactor LDAP DB option parsing code
Greg Hudson [Tue, 29 Jan 2013 01:15:01 +0000 (20:15 -0500)] 
Refactor LDAP DB option parsing code

krb5_ldap_open and krb5_ldap_create contain two large, almost
identical blocks of DB option processing code.  Factor it out into a
new function krb5_ldap_parse_db_params in ldap_misc.c, and simplify
the factored-out code.  Create a helper function to add server entries
and use it to simplify krb5_ldap_read_server_params as well as DB
option parsing.  Since the new DB option helper uses isspace instead
of isblank, we no longer require portability goop for isblank.

12 years agoMake kproplog handle underfull iprop logs
Greg Hudson [Fri, 25 Jan 2013 23:59:09 +0000 (18:59 -0500)] 
Make kproplog handle underfull iprop logs

kproplog currently assumes that an iprop log is full once it has
circled--which is true right now but will need to change for
hierarchical slaves.  Avoid this assumption by using the correct
index modulus in print_update whether or not the log is full.

Based on a patch from Richard Basch <basch@alum.mit.edu>.

12 years agoCheck for negative poll timeout in k5_sendto_kdc
Greg Hudson [Fri, 25 Jan 2013 18:11:27 +0000 (13:11 -0500)] 
Check for negative poll timeout in k5_sendto_kdc

ticket: 7553
target_version: 1.11.1
tags: pullup

12 years agoQuiet kpropd.c signed/unsigned comparison warnings
Nicolas Williams [Thu, 25 Oct 2012 17:36:26 +0000 (12:36 -0500)] 
Quiet kpropd.c signed/unsigned comparison warnings

[ghudson@mit.edu: simplify slightly]

12 years agoAdjust kdb5.c check for ulog being mapped
Greg Hudson [Thu, 24 Jan 2013 18:13:36 +0000 (13:13 -0500)] 
Adjust kdb5.c check for ulog being mapped

Check the ulog pointer, which is a little more direct, rather than the
ulogfd field.  (ulogfd is currently initialized to 0 prior to
ulog_map; we could fix that instead, but this feels simpler.)

12 years agoRemove ulog_check(); the ulog is not a DB journal
Nicolas Williams [Thu, 25 Oct 2012 23:26:10 +0000 (18:26 -0500)] 
Remove ulog_check(); the ulog is not a DB journal

The db2 DB is not power-fail safe.  There's no point trying to
replay an incompletely committed entry from the ulog at kadmind
startup time.  For that matter, even if the db2 DB was power-fail
safe there'd be no point replaying an uncommitted entry from the
ulog as the libkadm5srv app (nor any client of it, as in the case of
kadmind) will not have received any notice of success -- it'd be
wrong to complete that operation later when the user thought it'd
failed.

[ghudson@mit.edu: merge with master, adjust comment]

ticket: 7552 (new)

12 years agoPropagate policy changes over iprop via full dump
Greg Hudson [Wed, 23 Jan 2013 03:29:30 +0000 (22:29 -0500)] 
Propagate policy changes over iprop via full dump

Since iprop cannot carry policy changes, force a full resync to happen
each time a policy change occurs.  Based on a patch from
Richard Basch <basch@alum.mit.edu>.

ticket: 7522

12 years agoVerify iprop test results more thoroughly
Greg Hudson [Wed, 23 Jan 2013 03:12:51 +0000 (22:12 -0500)] 
Verify iprop test results more thoroughly

In k5test.py, allow run_kadminl to take an environment argument.  In
t_iprop.py, perform some queries on the slaves after each propagation
to spot-check that it got modifications from master.  Use a helper
function to check serial numbers for conciseness.

12 years agoFix iprop log reinitialization
Greg Hudson [Tue, 22 Jan 2013 22:42:37 +0000 (17:42 -0500)] 
Fix iprop log reinitialization

If the master iprop log is reinitialized to serial number 0, slaves
will need to take a full dump--but after that happens, we need to know
whether the slave has taken that full dump, we we don't offering full
dumps indefinitely.

So, record a timestamp in kdb_last_time when we reinitialize the log
header, and compare the slave timestamp to kdb_last_time whenever it
has the current serial number, even if it's 0.  Test this by
performing a propagation with sno 0 in t_iprop.py and detecting
whether kpropd gets a second UPDATE_FULL_RESYNC_NEEDED response from
kadmind.

ticket: 7550 (new)

12 years agoModernize style of kdb_log.c
Greg Hudson [Tue, 22 Jan 2013 06:42:31 +0000 (01:42 -0500)] 
Modernize style of kdb_log.c

ulog_get_entries had an unreachable branch which was removed during
de-indentation.

12 years agoClean up iprop flow control in kdb5.c
Greg Hudson [Fri, 18 Jan 2013 07:01:55 +0000 (02:01 -0500)] 
Clean up iprop flow control in kdb5.c

Add a helper predicate to determine whether to log operations.  In the
predicate, check if the ulog is actually mapped.  Use a single cleanup
label in krb5_db_put_principal.  Use a cleanup label in
krb5_db_delete_principal instead of releasing resources individually
at each exit point.  Avoid locking and unlocking the ulog if we're not
logging (although it would be a no-op).

Based on a patch from Nico Williams <nico@cryptonector.com>.

12 years agoFix iprop safety net in kdb5_util load
Greg Hudson [Thu, 17 Jan 2013 17:49:57 +0000 (12:49 -0500)] 
Fix iprop safety net in kdb5_util load

The error message was missing a newline, and the exit behavior causes
the database to be destroyed.

ticket: 7370
target_version: 1.11.1
tags: pullup

12 years agoRevert previous ("Sphinx doc: consolidate...")
Tom Yu [Wed, 16 Jan 2013 22:45:41 +0000 (17:45 -0500)] 
Revert previous ("Sphinx doc: consolidate...")

This reverts commit 87634edc472cebde4a37d002b7006ed38a1b25c2.

That commit is not neutral with respect to the rendering of the HTML,
and causes the version built with the logo to look unacceptably
disordered.

12 years agoSphinx doc: consolidate style markup in kerb.css
Zhanna Tsitkov [Wed, 16 Jan 2013 20:38:31 +0000 (15:38 -0500)] 
Sphinx doc: consolidate style markup in kerb.css

12 years agoGet rid of krb5_read_realm_params
Greg Hudson [Wed, 16 Jan 2013 16:38:55 +0000 (11:38 -0500)] 
Get rid of krb5_read_realm_params

Read realm parameters directly from the profile in the KDC's
init_realm(), getting rid of the intermediate krb5_realm_params
structure.  Then get rid of krb5_realm_params and
krb5_read_realm_params, since nothing else uses it.

12 years agoRemove KDC macros for realm config fields
Greg Hudson [Sun, 13 Jan 2013 15:54:37 +0000 (10:54 -0500)] 
Remove KDC macros for realm config fields

Stop using macros to refer to kdc_realm_t fields, as they could
conflict with structure field names for the same.  Leave behind the
kdc_context and tgs_server macros for now.

12 years agoRemove unused krb5_realm_params fields
Greg Hudson [Tue, 15 Jan 2013 13:43:10 +0000 (08:43 -0500)] 
Remove unused krb5_realm_params fields

krb5_realm_params is only consumed by the KDC (everything else uses
kadm5_config_params), so only needs to contain fields used by the KDC.
Get rid of everything else.  Also get rid of realm_profile, which is
read in by KDC code but never used (and was never set anyway).

12 years agoHelp Sphinx to diff C-types for better x-reference
Zhanna Tsitkov [Mon, 14 Jan 2013 18:54:25 +0000 (13:54 -0500)] 
Help Sphinx to diff C-types for better x-reference

In some cases Doxygen xml output does not provide accurate classification
of the various C-types, thus preventing the full documentation x-referencing.
Give some hints to the Doxy/RST bridge.

12 years agoCorrect typo in krb5_responder_context_st descr
Zhanna Tsitkov [Mon, 14 Jan 2013 18:46:05 +0000 (13:46 -0500)] 
Correct typo in krb5_responder_context_st descr

responder_get_challenge() meant to be krb5_responder_get_challenge()

12 years agoClean up style of alt_prof.c
Greg Hudson [Sat, 12 Jan 2013 05:21:07 +0000 (00:21 -0500)] 
Clean up style of alt_prof.c

Get rid of K&R-style function headers, format code and comments
consistently according to current conventions, rename some variables
using idiomatic names, and de-indent some nested control blocks.

12 years agoFlesh out responder context doxygen markup
Greg Hudson [Sat, 12 Jan 2013 04:55:07 +0000 (23:55 -0500)] 
Flesh out responder context doxygen markup

12 years agoUse [out] more sparingly in doxygen markup
Greg Hudson [Fri, 11 Jan 2013 23:32:55 +0000 (18:32 -0500)] 
Use [out] more sparingly in doxygen markup

In krb5.hin doxygen markup, only use [out] or [in,out] when a function
changes the entire value of what the parameter points to, not when the
function mutates a larger object (especially an abstract object).

Also remove a couple of incorrect [in] annotations, change a few
parameter descriptions to be more consistent, and fix one typo.

12 years agoModify rst toolkit to handle "linebreak" tag
Zhanna Tsitkov [Fri, 11 Jan 2013 22:17:21 +0000 (17:17 -0500)] 
Modify rst toolkit to handle "linebreak" tag

12 years agoBetter doxygen markup for RESPONDER_QUESTION_OTP
Zhanna Tsitkov [Fri, 11 Jan 2013 20:40:28 +0000 (15:40 -0500)] 
Better doxygen markup for RESPONDER_QUESTION_OTP

Doxygen and, consequently, Sphinx gets confused with the
KRB5_RESPONDER_QUESTION_OTP comment layout.
Also, mark the output parameter of krb5_responder_set_answer().

12 years agoFix label conflicts in Sphinx documentation
Zhanna Tsitkov [Fri, 11 Jan 2013 20:22:23 +0000 (15:22 -0500)] 
Fix label conflicts in Sphinx documentation

12 years agoUpdate copyright year in prototype sources
Ben Kaduk [Fri, 11 Jan 2013 20:14:02 +0000 (15:14 -0500)] 
Update copyright year in prototype sources

12 years agoSimplify KDC host referral code
Greg Hudson [Fri, 11 Jan 2013 18:26:37 +0000 (13:26 -0500)] 
Simplify KDC host referral code

Remove some unnecessary optimizations to reduce code complexity.  Get
rid of krb5_match_config_pattern in favor of a simpler helper function
in do_tgs_req_c.  Get rid of KRB5_CONF_ASTERISK and just use "*"
instead.  Use a helper function to combine [kdcdefaults] and realm
subsection values of variables, and don't bother adding leading and
trailing spaces.  Consistently use the names "hostbased" and
"no_referral" to refer to variable values (with a "realm_" prefix for
structures which currently use it).

12 years agoTest multi-value host referral variables
Greg Hudson [Fri, 11 Jan 2013 18:15:43 +0000 (13:15 -0500)] 
Test multi-value host referral variables

host_based_services and no_host_referral are allowed to have multiple
relations in each place they appear, so alter a couple of the test
cases to exercise that.