krb5.git
15 years agoCheck C++ compatibility for some internal headers that may (now or in
Ken Raeburn [Mon, 9 Feb 2009 16:36:09 +0000 (16:36 +0000)]
Check C++ compatibility for some internal headers that may (now or in
the future) be used in C++ code on Windows.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21919 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoMore C++ compatibility: Don't use "typedef struct tag *tag"; rename
Ken Raeburn [Mon, 9 Feb 2009 16:35:01 +0000 (16:35 +0000)]
More C++ compatibility: Don't use "typedef struct tag *tag"; rename
the tag and keep the same typedefname.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21918 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoC++ compatibility fix -- g++ says "types may not be defined in casts",
Ken Raeburn [Mon, 9 Feb 2009 16:28:29 +0000 (16:28 +0000)]
C++ compatibility fix -- g++ says "types may not be defined in casts",
so do the gcc unaligned-struct trick only for C, not C++.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21917 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFor Sun CC, also make implicit function declarations into errors
Ken Raeburn [Mon, 9 Feb 2009 16:15:51 +0000 (16:15 +0000)]
For Sun CC, also make implicit function declarations into errors

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21916 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoSupply missing fn declarations
Ken Raeburn [Mon, 9 Feb 2009 16:14:38 +0000 (16:14 +0000)]
Supply missing fn declarations

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21915 dc483132-0cff-0310-8789-dd5450dbe970

15 years agouse unsigned value for shifting, avoiding undefined behavior
Ken Raeburn [Mon, 9 Feb 2009 16:07:42 +0000 (16:07 +0000)]
use unsigned value for shifting, avoiding undefined behavior

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21914 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFor Sun CC, create one errwarn arg with commas instead of multiple
Ken Raeburn [Mon, 9 Feb 2009 15:57:58 +0000 (15:57 +0000)]
For Sun CC, create one errwarn arg with commas instead of multiple

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21913 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoMemory handling fixes in walk_rtree
Greg Hudson [Fri, 6 Feb 2009 20:43:44 +0000 (20:43 +0000)]
Memory handling fixes in walk_rtree

In walk_rtree's rtree_hier_tree, don't leak the result of
rtree_hier_realms.  In rtree_hier_realms, avoid freeing one too many
krb5_data contents on allocation failure, and use the recommend
pattern to ensure well-defined output parameter values.

ticket: 6376
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21912 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFix whitespace on previous commit to ure.c. Correct two other cases
Greg Hudson [Fri, 6 Feb 2009 19:46:40 +0000 (19:46 +0000)]
Fix whitespace on previous commit to ure.c.  Correct two other cases
where %lX was used with a krb5_ui_4 type argument without a cast to
unsigned long.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21911 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoPass the correct width argument to fprintf for URE_CHAR in
Greg Hudson [Fri, 6 Feb 2009 19:18:20 +0000 (19:18 +0000)]
Pass the correct width argument to fprintf for URE_CHAR in
ure_write_dfa.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21910 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFix error handling in krb5_walk_realm_tree
Greg Hudson [Fri, 6 Feb 2009 18:40:04 +0000 (18:40 +0000)]
Fix error handling in krb5_walk_realm_tree

rtree_hier_realms was forgetting to assign the return value of
krb5int_copy_data_contents to retval, which would cause a failure to
notice out-of-memory conditions.

ticket: 6375
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21909 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoUnsigned/signed fixes
Ezra Peisach [Fri, 6 Feb 2009 05:42:32 +0000 (05:42 +0000)]
Unsigned/signed fixes

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21908 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoChange variable accepting return from strftime to time_t. This
Ezra Peisach [Fri, 6 Feb 2009 05:31:09 +0000 (05:31 +0000)]
Change variable accepting return from strftime to time_t.  This
matches prototype for function and removes a signed/unsigned warning.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21907 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoDo not assume sizeof(bool_t) == sizeof(krb5_boolean)
Ezra Peisach [Fri, 6 Feb 2009 05:22:34 +0000 (05:22 +0000)]
Do not assume sizeof(bool_t) == sizeof(krb5_boolean)

bool_t is defined as int, krb5_boolean as unsigned int.  These are
similar size but someone someday might change the krb5_boolean.
Instead of passing a krb5_boolean * to xdr_bool, implement xdr_krb5_boolean
which keeps the different types separate.

This cleans up a number of warnings.

ticket: 6374

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21906 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoUnsigned/signed warnings cleanup
Ezra Peisach [Fri, 6 Feb 2009 02:46:14 +0000 (02:46 +0000)]
Unsigned/signed warnings cleanup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21905 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoCleanup some warnings due to getsockname's third argument is sometimes
Ezra Peisach [Fri, 6 Feb 2009 02:45:21 +0000 (02:45 +0000)]
Cleanup some warnings due to getsockname's third argument is sometimes
unsigned. Use GETSOCKNAME_ARG3_TYPE and fallback to int if not defined.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21904 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoremove some redundant or useless qualifiers
Ken Raeburn [Fri, 6 Feb 2009 01:07:32 +0000 (01:07 +0000)]
remove some redundant or useless qualifiers

Remove some redundant qualifiers specified redundantly multiple times more than once in variable declarations.
Also remove some useless qualifiers in casts and function argument declarations.

ticket: 6373
target_version: 1.7
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21903 dc483132-0cff-0310-8789-dd5450dbe970

15 years agouse casts, for c++ compilation on windows
Ken Raeburn [Thu, 5 Feb 2009 21:56:21 +0000 (21:56 +0000)]
use casts, for c++ compilation on windows

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21902 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFix memory handling bug in mk_req_ext
Greg Hudson [Thu, 5 Feb 2009 21:27:54 +0000 (21:27 +0000)]
Fix memory handling bug in mk_req_ext

In make_etype_list, assign *authdata before we have a chance to fail,
since we may have invalidated the previous value with realloc.

ticket: 6372
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21901 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodeal with memleaks in migrate mkey project
Will Fiveash [Thu, 5 Feb 2009 20:57:09 +0000 (20:57 +0000)]
deal with memleaks in migrate mkey project

Ken R. told me that Coverity found several potential memleaks introduced
by the mkey migration project.  This addresses those leaks and tweaks
the code formatting in a few places.

ticket: 6371
Version_Reported: 1.7
Target_Version: 1.7
Tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21900 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn gc_frm_kdc.c's do_traversal(), fix an assert which was doing an
Greg Hudson [Thu, 5 Feb 2009 20:07:45 +0000 (20:07 +0000)]
In gc_frm_kdc.c's do_traversal(), fix an assert which was doing an
assignment instead of a compare.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21899 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn krb5_rc_io_store, check the return value of krb5int_buf_len as well
Greg Hudson [Thu, 5 Feb 2009 19:59:09 +0000 (19:59 +0000)]
In krb5_rc_io_store, check the return value of krb5int_buf_len as well
as krb5int_buf_data.  The length can't be negative if the data is
non-NULL, but Coverity doesn't know that.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21898 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn recvauth_common, initialize ap_option. It can't be used
Greg Hudson [Thu, 5 Feb 2009 19:50:41 +0000 (19:50 +0000)]
In recvauth_common, initialize ap_option.  It can't be used
uninitialized, but you can only deduce that by examining the
relationships between ap_option, problem, and outbuf.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21897 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoChange krb5_rc_resolve_type (not a public API) to allocate the rcache
Greg Hudson [Thu, 5 Feb 2009 19:44:35 +0000 (19:44 +0000)]
Change krb5_rc_resolve_type (not a public API) to allocate the rcache
structure.  Make output parameter values of krb5_rc_resolve_type and
krb5_rc_default well-defined in case of errors.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21896 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoDetect failure to register with rpcbind/portmap due to security
Ezra Peisach [Thu, 5 Feb 2009 19:02:29 +0000 (19:02 +0000)]
Detect failure to register with rpcbind/portmap due to security
restrictons and not bomb out in tests.

ticket: 6349

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21895 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoAdd a missing break in the switch statement of
Greg Hudson [Thu, 5 Feb 2009 18:43:08 +0000 (18:43 +0000)]
Add a missing break in the switch statement of
krb5int_setpw_result_code_string.

ticket: 6368
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21894 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoCreate and use (in several places) a variant of
Ken Raeburn [Thu, 5 Feb 2009 18:42:10 +0000 (18:42 +0000)]
Create and use (in several places) a variant of
krb5int_copy_data_contents that adds a trailing '\0' so the result can
be used as a C string.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21893 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn krb5_ktfileint_find_slot, check for an error return from ftell.
Greg Hudson [Thu, 5 Feb 2009 18:34:57 +0000 (18:34 +0000)]
In krb5_ktfileint_find_slot, check for an error return from ftell.
(Such an error will never happen in any reasonable stdio
implementation but it's more correct to check.)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21892 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoCoverity was nervous that hst_realm.c's domain_heuristic() wasn't
Greg Hudson [Thu, 5 Feb 2009 18:26:47 +0000 (18:26 +0000)]
Coverity was nervous that hst_realm.c's domain_heuristic() wasn't
checking for a NULL return from strchr.  The code was safe because a
previous call to strchr on the same argments was checked, but make
Coverity less nervous by storing the result of that previous call and
reusing it.  Also make the function conform better to our standards.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21891 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFix a memory leak in krb5_kt_resolve when we fail to lock
Greg Hudson [Thu, 5 Feb 2009 18:19:23 +0000 (18:19 +0000)]
Fix a memory leak in krb5_kt_resolve when we fail to lock
kt_typehead_lock.

ticket: 6367
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21890 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoinclude omitted system header string.h
Ken Raeburn [Thu, 5 Feb 2009 02:59:08 +0000 (02:59 +0000)]
include omitted system header string.h

Sun cc warns about some of the string functions being undeclared in
several source files.  So, include string.h there.

ticket: 6365
target_version: 1.7
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21889 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodeclare replacement [v]asprintf functions
Ken Raeburn [Thu, 5 Feb 2009 02:16:22 +0000 (02:16 +0000)]
declare replacement [v]asprintf functions

If HAVE_VASPRINTF is not defined, make sure krb5int_{,v}asprintf
functions always get declared, applying the preprocessor conditional
test only to the GCC format attribute.  If HAVE_VASPRINTF is defined,
don't declare them at all.

This fixes a bunch of function-not-declared warnings under Sun cc.

ticket: 6364
target_version: 1.7
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21888 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoint/ptr bug in gssapi code
Ken Raeburn [Thu, 5 Feb 2009 01:49:21 +0000 (01:49 +0000)]
int/ptr bug in gssapi code

Fix a pointer argument passed where an integer is needed.
Update Sun compiler options to make that an error.  (The options we're
currently using make it an error for assignment but not for argument passing.)

ticket: 6363
target_version: 1.7
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21887 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodon't do arithmetic on void pointers
Ken Raeburn [Wed, 4 Feb 2009 23:28:09 +0000 (23:28 +0000)]
don't do arithmetic on void pointers

Fix one file in gssapi where we compute offsets from a void* without casting.
Change options used with Sun compiler to make such expressions an error.

ticket: 6362

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21886 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoregenerate
Ken Raeburn [Wed, 4 Feb 2009 23:06:12 +0000 (23:06 +0000)]
regenerate

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21885 dc483132-0cff-0310-8789-dd5450dbe970

15 years agonew multi-masterkey support doesn't work well when system clock is set
Will Fiveash [Wed, 4 Feb 2009 22:29:44 +0000 (22:29 +0000)]
new multi-masterkey support doesn't work well when system clock is set
back

The ticket contains the details.

ticket: 6361

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21884 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoRemove xfread/xfwrite macros. Casting the first argument to char * is
Greg Hudson [Wed, 4 Feb 2009 20:32:05 +0000 (20:32 +0000)]
Remove xfread/xfwrite macros.  Casting the first argument to char * is
unnecessary (fread's first argument is void *, which does not require
a cast) and confuses Coverity's UNINIT checker; casting the third
argument to unsigned is not necessary for our current set of warnings.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21883 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn tcl_ovsec_kadm_get_policy, initialize ent since (at least in
Greg Hudson [Wed, 4 Feb 2009 19:31:33 +0000 (19:31 +0000)]
In tcl_ovsec_kadm_get_policy, initialize ent since (at least in
theory) there's a code path which gets through to the finalizers
without setting it.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21882 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn krb5int_utf8s_to_ucs2les, free the correct value on error, instead
Greg Hudson [Wed, 4 Feb 2009 19:25:51 +0000 (19:25 +0000)]
In krb5int_utf8s_to_ucs2les, free the correct value on error, instead
of the caller-supplied result pointer.

ticket: 6360
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21881 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoInclude k5-int.h in several pkinit source files, in order to define
Greg Hudson [Wed, 4 Feb 2009 19:15:13 +0000 (19:15 +0000)]
Include k5-int.h in several pkinit source files, in order to define
the KRB5_CONFIG symbols now used by those files.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21880 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoUse macros for config parameters
Zhanna Tsitkov [Wed, 4 Feb 2009 17:08:44 +0000 (17:08 +0000)]
Use macros for config parameters

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21879 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoremove some krb4 testing hooks
Ken Raeburn [Wed, 4 Feb 2009 03:18:04 +0000 (03:18 +0000)]
remove some krb4 testing hooks

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21878 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodon't create or delete krb.conf, krb.realms
Ken Raeburn [Wed, 4 Feb 2009 02:41:24 +0000 (02:41 +0000)]
don't create or delete krb.conf, krb.realms

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21877 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoprefer structure assignment to memcpy
Ken Raeburn [Tue, 3 Feb 2009 16:38:34 +0000 (16:38 +0000)]
prefer structure assignment to memcpy

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21876 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoRemove unnecessary pointer casts in args to free,memcpy,memset,memchr except unicode...
Ken Raeburn [Mon, 2 Feb 2009 23:41:40 +0000 (23:41 +0000)]
Remove unnecessary pointer casts in args to free,memcpy,memset,memchr except unicode, windows code

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21875 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoTWRITE_STR casts second argument; don't add redundant casting
Ken Raeburn [Mon, 2 Feb 2009 22:28:34 +0000 (22:28 +0000)]
TWRITE_STR casts second argument; don't add redundant casting

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21874 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFix a whitespace error introduced when fixing a typo in the defines
Greg Hudson [Mon, 2 Feb 2009 21:55:13 +0000 (21:55 +0000)]
Fix a whitespace error introduced when fixing a typo in the defines
added to k5-int.h.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21873 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoFix a typo in the defines added to k5-int.h
Greg Hudson [Mon, 2 Feb 2009 21:53:16 +0000 (21:53 +0000)]
Fix a typo in the defines added to k5-int.h

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21872 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIntroduces macros for config parameters
Zhanna Tsitkov [Mon, 2 Feb 2009 21:34:19 +0000 (21:34 +0000)]
Introduces macros for config parameters

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21871 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoGet rid of casts of free() argument to char*, except where it's
Ken Raeburn [Mon, 2 Feb 2009 21:13:42 +0000 (21:13 +0000)]
Get rid of casts of free() argument to char*, except where it's
casting away const (so as to make this change warning-neutral), and in
unicode source (which we may want to keep in sync with another
source), and krb5_xfree macro (to be handled separately).

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21870 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoCollect hairy parts of krb5_is_<msgtype> macros into one helper macro
Ken Raeburn [Mon, 2 Feb 2009 20:56:18 +0000 (20:56 +0000)]
Collect hairy parts of krb5_is_<msgtype> macros into one helper macro

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21869 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoRevise last change to better resemble the original test, keeping the
Ken Raeburn [Mon, 2 Feb 2009 20:37:41 +0000 (20:37 +0000)]
Revise last change to better resemble the original test, keeping the
min-lifetime test code collected together.  Change policy to have a
minimum password lifetime of 10s instead of 30s, and reduce the test
delays accordingly.

ticket: 6358

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21868 dc483132-0cff-0310-8789-dd5450dbe970

15 years agospeed up kpasswd tests
Ken Raeburn [Mon, 2 Feb 2009 19:29:52 +0000 (19:29 +0000)]
speed up kpasswd tests

Reorder some tests and tune delays, so that we don't need to run for
much more than twice the min-password-life interval when testing that
functionality.  (This could be made faster if we can assume that
init_db will always have been run immediately before the tests start.)

In my tests, this cuts something like 11 seconds off the run time (now
down to about 65 seconds).

ticket: 6358

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21867 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoaddress lib/kadm5 test suite slowness
Ken Raeburn [Mon, 2 Feb 2009 18:42:06 +0000 (18:42 +0000)]
address lib/kadm5 test suite slowness

In mod-principal tests for clearing the principal's policy, instead of
just testing to see if the wrong string is output and timing out
looking for it, check also for the new expected value.  Cuts test
suite run time by about two minutes for each pass (client vs server).

ticket: 6357
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21866 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodon't delay so long while waiting for daemon startup
Ken Raeburn [Mon, 2 Feb 2009 18:29:28 +0000 (18:29 +0000)]
don't delay so long while waiting for daemon startup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21865 dc483132-0cff-0310-8789-dd5450dbe970

15 years agocomment needed some grammatical/typographical fixes too
Ken Raeburn [Mon, 2 Feb 2009 18:14:50 +0000 (18:14 +0000)]
comment needed some grammatical/typographical fixes too

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21864 dc483132-0cff-0310-8789-dd5450dbe970

15 years agocomment whitespace
Ken Raeburn [Mon, 2 Feb 2009 18:12:57 +0000 (18:12 +0000)]
comment whitespace

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21863 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoreapply memchr patch
Ken Raeburn [Mon, 2 Feb 2009 18:10:30 +0000 (18:10 +0000)]
reapply memchr patch

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21862 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoexplicitly initialize pointer fields after memset (for coverity)
Ken Raeburn [Mon, 2 Feb 2009 17:39:59 +0000 (17:39 +0000)]
explicitly initialize pointer fields after memset (for coverity)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21861 dc483132-0cff-0310-8789-dd5450dbe970

15 years agosmall storage leak in KDC startup
Ken Raeburn [Mon, 2 Feb 2009 16:54:38 +0000 (16:54 +0000)]
small storage leak in KDC startup

Remove duplicate strdup call.

ticket: 6356
target_version: 1.7
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21860 dc483132-0cff-0310-8789-dd5450dbe970

15 years agouse t_inetd with a ready message and avoid waiting a lot in non-root tests
Ken Raeburn [Sat, 31 Jan 2009 04:39:34 +0000 (04:39 +0000)]
use t_inetd with a ready message and avoid waiting a lot in non-root tests

Change t_inetd to print a ready message when it has started listening
on the indicated port number.

Look for this message in sample.exp rather than waiting an arbitrary
(and usually excessive) 2s each time for the inetd-mode tests.  Use
run_once to perform the standalone-mode test only once per test suite
invocation.

Change rsh and rcp tests to start the servers via t_inetd and avoid
excessive waiting at startup.

In some of my tests, this reduces the tests/dejagnu tests from taking
over 6 minutes to taking around 2 minutes.

(This does mean the server process will no longer have started up
before we launch the client, so it may be slower to respond, but it'll
still be faster than the 2s delay we used before even trying to
connect.)

We can probably eliminate the -D option code from krshd.c now.

The tests run as root (rlogin, telnet) still need updating.

ticket: 6355
target_version: 1.7
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21855 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoback to trunk
Tom Yu [Sat, 31 Jan 2009 04:04:50 +0000 (04:04 +0000)]
back to trunk

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21854 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoREADME and patchlevel.h for 1.7 release branch
Tom Yu [Sat, 31 Jan 2009 04:00:10 +0000 (04:00 +0000)]
README and patchlevel.h for 1.7 release branch

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21852 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoDefault allow_weak_crypto=true for now. Default supported_enctypes to
Tom Yu [Sat, 31 Jan 2009 03:57:20 +0000 (03:57 +0000)]
Default allow_weak_crypto=true for now.  Default supported_enctypes to
exclude single-DES enctypes.

ticket: 6353
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21851 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoexport new functions
Ken Raeburn [Sat, 31 Jan 2009 02:55:25 +0000 (02:55 +0000)]
export new functions

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21850 dc483132-0cff-0310-8789-dd5450dbe970

15 years agofix resource leak
Ken Raeburn [Sat, 31 Jan 2009 01:50:37 +0000 (01:50 +0000)]
fix resource leak

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21849 dc483132-0cff-0310-8789-dd5450dbe970

15 years agorecode as more straight-line code to simplify analysis
Ken Raeburn [Sat, 31 Jan 2009 01:07:04 +0000 (01:07 +0000)]
recode as more straight-line code to simplify analysis

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21848 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodon't use uninitialized variable
Ken Raeburn [Sat, 31 Jan 2009 00:54:33 +0000 (00:54 +0000)]
don't use uninitialized variable

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21847 dc483132-0cff-0310-8789-dd5450dbe970

15 years agohandle freeing null keyblock
Ken Raeburn [Sat, 31 Jan 2009 00:49:53 +0000 (00:49 +0000)]
handle freeing null keyblock

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21846 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodon't double-free
Ken Raeburn [Sat, 31 Jan 2009 00:39:51 +0000 (00:39 +0000)]
don't double-free

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21845 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoMaster Key Migration Project
Will Fiveash [Fri, 30 Jan 2009 23:55:14 +0000 (23:55 +0000)]
Master Key Migration Project

Commit for the Master Key Migration Project.
http://k5wiki.kerberos.org/wiki/Projects/Master_Key_Migration

This commit provides the ability to add a new master key (with an
enctype differing from the current master key) to the master key
principal and stash file and then migrate the encryption of existing
principals long term keys to use the new master key.  In addition
deletion of master keys is provided.

ticket: 6354

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21844 dc483132-0cff-0310-8789-dd5450dbe970

15 years agokrb5_get_server_rcache had some dead (and incorrect) code for cleaning
Greg Hudson [Fri, 30 Jan 2009 21:25:40 +0000 (21:25 +0000)]
krb5_get_server_rcache had some dead (and incorrect) code for cleaning
up the rcache on failure.  Fix the cleanup code and make use of it.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21842 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoMake output parameter value of krb5_rc_resolve_full well-defined on
Greg Hudson [Fri, 30 Jan 2009 21:22:31 +0000 (21:22 +0000)]
Make output parameter value of krb5_rc_resolve_full well-defined on
error return.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21841 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn krb5_kdcrep2creds, call the correct free function when cleaning up
Greg Hudson [Fri, 30 Jan 2009 21:21:10 +0000 (21:21 +0000)]
In krb5_kdcrep2creds, call the correct free function when cleaning up
the keyblock, and clean up the keyblock if krb5_copy_data fails.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21840 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoChanged the name match_config_pattern to krb5_match_config_pattern. Check strdup...
Zhanna Tsitkov [Fri, 30 Jan 2009 20:40:46 +0000 (20:40 +0000)]
Changed the name match_config_pattern to krb5_match_config_pattern. Check strdup return code.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21838 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIntroduced match_config_pattern function to find a pattern in the config value strings
Zhanna Tsitkov [Thu, 29 Jan 2009 19:23:22 +0000 (19:23 +0000)]
Introduced match_config_pattern function to find a pattern in the config value strings

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21828 dc483132-0cff-0310-8789-dd5450dbe970

15 years agowhitespace
Ken Raeburn [Thu, 29 Jan 2009 01:19:01 +0000 (01:19 +0000)]
whitespace

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21826 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoclear outbuf[0].data to unconfuse coverity
Ken Raeburn [Thu, 29 Jan 2009 01:12:17 +0000 (01:12 +0000)]
clear outbuf[0].data to unconfuse coverity

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21825 dc483132-0cff-0310-8789-dd5450dbe970

15 years agodisable single-DES by default
Tom Yu [Wed, 28 Jan 2009 23:22:27 +0000 (23:22 +0000)]
disable single-DES by default

Mark all single-DES enctypes as "weak", and create a new libdefaults
variable "allow_weak_crypto", which defaults to "false".

ticket: 6353
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21823 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoinclude netinet/in.h to make sure we know what struct in_addr looks like
Ken Raeburn [Wed, 28 Jan 2009 17:01:36 +0000 (17:01 +0000)]
include netinet/in.h to make sure we know what struct in_addr looks like

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21820 dc483132-0cff-0310-8789-dd5450dbe970

15 years agono more -r option for setting krb.conf path
Ken Raeburn [Wed, 28 Jan 2009 05:42:11 +0000 (05:42 +0000)]
no more -r option for setting krb.conf path

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21819 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoremove some remnants of krb4-related config file options
Ken Raeburn [Wed, 28 Jan 2009 05:37:10 +0000 (05:37 +0000)]
remove some remnants of krb4-related config file options

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21818 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoreturn correct kvno in TGS case
Sam Hartman [Wed, 28 Jan 2009 01:28:25 +0000 (01:28 +0000)]
return correct kvno in TGS case

krb5_c_encrypt sets the kvno of ciphertext to 0.
So fill it in after the call to encrypt_tkt_part.

ticket: 6352

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21815 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoRun a single expect statement to read from both client and server, to
Tom Yu [Wed, 28 Jan 2009 00:32:29 +0000 (00:32 +0000)]
Run a single expect statement to read from both client and server, to
avoid an apparent race condition on Darwin.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21814 dc483132-0cff-0310-8789-dd5450dbe970

15 years agowhitespace
Ken Raeburn [Wed, 28 Jan 2009 00:30:06 +0000 (00:30 +0000)]
whitespace

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21813 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoStart to phase out krb5_xfree macro, which just casts its argument to
Ken Raeburn [Wed, 28 Jan 2009 00:04:15 +0000 (00:04 +0000)]
Start to phase out krb5_xfree macro, which just casts its argument to
char* and calls free.

Replace most uses, outside of the LDAP KDB plugin, which doesn't build
on my test system of the moment because of version dependencies.  Add
one explicit cast to make the change warning-neutral (under gcc 4.0.1
on Mac OS X 10.5.6).

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21812 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoHelper script for processing valgrind logs that don't indicate any errors, or are...
Ken Raeburn [Tue, 27 Jan 2009 23:14:35 +0000 (23:14 +0000)]
Helper script for processing valgrind logs that don't indicate any errors, or are for system programs

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21810 dc483132-0cff-0310-8789-dd5450dbe970

15 years agouse memchr
Ken Raeburn [Tue, 27 Jan 2009 22:00:15 +0000 (22:00 +0000)]
use memchr

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21809 dc483132-0cff-0310-8789-dd5450dbe970

15 years ago"Coding practices" related fixes
Zhanna Tsitkov [Tue, 27 Jan 2009 21:09:35 +0000 (21:09 +0000)]
"Coding practices" related fixes

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21808 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn asn1_decode_pa_for_user(), ensure that user member is allocated
Luke Howard [Mon, 26 Jan 2009 22:50:02 +0000 (22:50 +0000)]
In asn1_decode_pa_for_user(), ensure that user member is allocated
before assigning a value to it.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21805 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIntroduced new static function prep_reprocess_req to make code more readable
Zhanna Tsitkov [Mon, 26 Jan 2009 21:26:33 +0000 (21:26 +0000)]
Introduced new static function prep_reprocess_req to make code more readable

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21801 dc483132-0cff-0310-8789-dd5450dbe970

15 years agogss_header|trailerlen should be unsigned int
Sam Hartman [Mon, 26 Jan 2009 20:02:54 +0000 (20:02 +0000)]
gss_header|trailerlen should be unsigned int

The krb5_c_crypto_length API returns unsigned int per its design.
so, use unsigned int not size_t for its output.

ticket: 6351

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21799 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoPreliminary update of README for krb5-1.7 release
Tom Yu [Mon, 26 Jan 2009 19:47:57 +0000 (19:47 +0000)]
Preliminary update of README for krb5-1.7 release

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21798 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoUse 16/32-bit big/little-endian store functions in more places
Ken Raeburn [Mon, 26 Jan 2009 19:06:21 +0000 (19:06 +0000)]
Use 16/32-bit big/little-endian store functions in more places

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21796 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoCheck asprintf return codes. Styling
Zhanna Tsitkov [Mon, 26 Jan 2009 16:20:41 +0000 (16:20 +0000)]
Check asprintf return codes. Styling

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21795 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoUse a struct in_addr to insure alignment of address - instead of
Ezra Peisach [Sun, 25 Jan 2009 16:44:02 +0000 (16:44 +0000)]
Use a struct in_addr to insure alignment of address - instead of
random alignment on the stack. Solaris 2.10 has issues if the address
is not aligned.  The rest of the code in the tree uses a struct
in_addr or mallocs the address - which will be sufficiently aligned.

ticket: 6308

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21794 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoChange 16/32/64-bit big-/little-endian/native unaligned load/store
Ken Raeburn [Sat, 24 Jan 2009 01:27:16 +0000 (01:27 +0000)]
Change 16/32/64-bit big-/little-endian/native unaligned load/store
routines to take void pointers, so they can operate on both plain and
unsigned char buffers, or other types.
Remove some now-unneeded casts.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21793 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoEliminate the need for the domain_realm mapping table on the client side by implement...
Zhanna Tsitkov [Fri, 23 Jan 2009 19:59:50 +0000 (19:59 +0000)]
Eliminate the need for the domain_realm mapping table on the client side by implementing minimal referral support in the KDC

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21792 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoRemove some null checks in cases where pointers can't be null
Greg Hudson [Fri, 23 Jan 2009 19:04:57 +0000 (19:04 +0000)]
Remove some null checks in cases where pointers can't be null

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21790 dc483132-0cff-0310-8789-dd5450dbe970

15 years agoIn krb5_pac_get_buffer, check the correct value for null after calling
Greg Hudson [Fri, 23 Jan 2009 19:01:56 +0000 (19:01 +0000)]
In krb5_pac_get_buffer, check the correct value for null after calling
malloc.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21789 dc483132-0cff-0310-8789-dd5450dbe970