Create referrals branch based on Andrew's work

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18559 dc483132-0cff-0310-8789-dd5450dbe970
Merge to trunk rev 18559

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18560 dc483132-0cff-0310-8789-dd5450dbe970
Documented current state and blocking issues

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18566 dc483132-0cff-0310-8789-dd5450dbe970
- conditionalized and depersonalized all debugging code
- fixed in_cred memory management problems (double_free/SEGV)
- rearranged storage use to leave in_cred inviolate and use temporary storage
  for referral traversal
- switched most explicit *alloc use to use library storage functions
- cleaned up referral tgt list management
- update TODO state

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18567 dc483132-0cff-0310-8789-dd5450dbe970
* walk_rtree.c (dbgref_dump_principal):Move here from
        gc_frm_kdc.c so make check works

* gc_frm_kdc.c (krb5_get_cred_from_kdc_opt): Fill in length of
realm after populating from client

* copy_princ.c (krb5_copy_principal): Always allocate space for realms even if they are empty.  Always defensively null terminate.  Note that realms may still have internal null characters; they are not strings.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18568 dc483132-0cff-0310-8789-dd5450dbe970
Added some known problems to bug list, removed assertion failure
fixed in #18568.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18569 dc483132-0cff-0310-8789-dd5450dbe970
* gc_frm_kdc.c (krb5_get_cred_from_kdc_opt): Replace server princ
in out_creds not in_creds

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18570 dc483132-0cff-0310-8789-dd5450dbe970
- Remove KRB5_REFERRAL_REALM check to separate function.
- Conditionalize gc_frm_kdc out_cred freeing so it doesn't SEGV on an
  early failure before out_cred is allocated.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18572 dc483132-0cff-0310-8789-dd5450dbe970
- krb5_parse_name now allows zero-length realms
- krb5_get_fallback_host_realm made string-safe
  (now takes *krb5_data instead of a maybe-string)
- conditionalized some previously-missed bits of debugging output
  (some of this should probably get nuked entirely since it's
  not really interesting anymore, but keeping easy debugging 
  hooks for the core referral logic seems very useful)
- return first-hop referral TGT for ccache
  (but should maybe not do so if already cached?)
- fixed a couple of stupid bugs in fallback realm code
- cleaned up some memory leaks (more surely remain)
- state updated

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18573 dc483132-0cff-0310-8789-dd5450dbe970
- added referral loop checking
- updated state

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18574 dc483132-0cff-0310-8789-dd5450dbe970
- Fixed some indentation inconsistencies.
- Fixed referral loop check.
- Fixed a bunch of memory leaks.
- Cleaned up whitespace.
- Updated state.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18575 dc483132-0cff-0310-8789-dd5450dbe970
Whitespace cleanup and state update

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18576 dc483132-0cff-0310-8789-dd5450dbe970
- Added comments to krb5_get_cred_from_kdc_opt commentary about memory
  management pitfalls.
- Removed a few obsolete and dangerous debugging hooks.
- Got rid of remaining C++-style comments.
- Updated state.
- Reviewed code for string-based assumptions; all that remain look OK.
  (Or, at least, were there before.  krb5_sname_to_principal returns the
  realm as a string, which since, first, it's originating the data, and
  second, ASCII NUL is a forbidden character in 4120-compliant realm
  names, and third, changing the API would be a bit of a bother, I'm
  going along with.)

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18577 dc483132-0cff-0310-8789-dd5450dbe970
Leak found with tgtq reuse under some circumstances.  Fixed

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18578 dc483132-0cff-0310-8789-dd5450dbe970
Eight-byte occasional leak found, fixed.  (It's not clear why this wasn't
being run over a lot more often; it should have been hit whenever
krb5_get_fallback_host_realm was used.)

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18579 dc483132-0cff-0310-8789-dd5450dbe970
Comment out some previously-missed debugging output

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18580 dc483132-0cff-0310-8789-dd5450dbe970
Split new symbols between krb5.h and k5-int.h, renaming to krb5int and
adding KRB5_CALLCONV as appropriate.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/referrals@18581 dc483132-0cff-0310-8789-dd5450dbe970