]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
- Added comments to krb5_get_cred_from_kdc_opt commentary about memory
authorAndrew Boardman <amb@mit.edu>
Sat, 9 Sep 2006 01:43:04 +0000 (01:43 +0000)
committerAndrew Boardman <amb@mit.edu>
Sat, 9 Sep 2006 01:43:04 +0000 (01:43 +0000)
  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

TODO
src/include/krb5/krb5.hin
src/lib/krb5/krb/gc_frm_kdc.c

diff --git a/TODO b/TODO
index d782448403a74334c47f59759fac8461e65c38c4..e89449838d2519aa4bef2f6d387788ab9f855081 100644 (file)
--- a/TODO
+++ b/TODO
@@ -8,6 +8,7 @@ outstanding issues:
   the first non-referral request to that realm (should such a request
   ever occur) will incur one extra round-trip after which it will be
   cached?
+  - at the moment, this check is disabled, and initial referral TGTs will be cached.
 
 final cleanup:
 =============
@@ -18,11 +19,11 @@ final cleanup:
   - other memory management issues (open-ended, but looking)
 - review code format (whitespace checked)
   -- nuke icky // comments (and probably attatched code)
-- catalog namespace changes for review
+- remove some of the less interesting debugging output?
 
 integration issues:
 ==================
-- review namespace use
+- review namespace use (mail sent to krbcore with brief summary)
 - decide whether to up MAXHOPS
 - merge with current trunk
 
index 701235f2bde2996aa1dcbc10d7a67cf822665835..a04b6306349c038c2016aa7fb37696022183ceeb 100644 (file)
@@ -273,7 +273,7 @@ krb5_boolean krb5_is_referral_realm(krb5_data *);
 /*
  * Referral debugging hooks.
  */
-#define DEBUG_REFERRALS
+/* #define DEBUG_REFERRALS */
 
 #ifdef DEBUG_REFERRALS
 void dbgref_dump_principal(char *, krb5_principal);
index daae9ca399d6fde0c759642b347ee03c07c706fe..4427ae17d2e2cda359ee4252ecbb30c10bea0bcd 100644 (file)
@@ -753,6 +753,11 @@ cleanup:
  * On success, OUT_CRED contains the desired credentials; the caller
  * must free them.
  *
+ * Beware memory management issues if you have modifications in mind.
+ * With the addition of referral support, it is now the case that *tgts,
+ * referral_tgts, tgtptr, referral_tgts, and *out_creds all may point to
+ * the same credential at different times.
+ *
  * Returns errors, system errors.
  */
 
@@ -785,8 +790,6 @@ krb5_get_cred_from_kdc_opt(krb5_context context, krb5_ccache ccache,
 
 
 #ifdef DEBUG_REFERRALS
-    /* Hack for testing to force a referral. */
-    // /* WARNING: uncomment for testing only. */ server->realm.data[0]=0;
     dbgref_dump_principal("gc_from_kdc initial client", client);
     dbgref_dump_principal("gc_from_kdc initial server", server);
 #endif
@@ -939,8 +942,6 @@ krb5_get_cred_from_kdc_opt(krb5_context context, krb5_ccache ccache,
 #ifdef DEBUG_REFERRALS
     dbgref_dump_principal("gc_from_kdc client at fallback", client);
     dbgref_dump_principal("gc_from_kdc server at fallback", server);
-    /* Hack for testing to shut down immediately after referral attempt. */
-    // /* WARNING: uncomment for testing only. */ printf("gc_from_kdc: referral failed; exiting.\n"),exit(1);
 #endif
 
     /*
@@ -1060,10 +1061,17 @@ cleanup:
 
     if (*tgts == NULL) {
         if (referral_tgts[0]) {
-           subretval=1; // XXX This should be something that scans the
-                        // ccache for this ticket, which we presumably
-                        // don't want to cache again....?
+#if 0
+           /*
+            * This should possibly be a check on the candidate return
+            * credential against the cache, in the circumstance where we
+            * don't want to clutter the cache with near-duplicate
+            * credentials on subsequent iterations.  For now, it is
+            * disabled.
+            */
+           subretval=...?;
            if (subretval) {
+#endif
                /* Allocate returnable TGT list. */
                if (!(*tgts=calloc(sizeof (krb5_creds *), 2)))
                    return ENOMEM;
@@ -1074,7 +1082,9 @@ cleanup:
 #ifdef DEBUG_REFERRALS
                dbgref_dump_principal("gc_from_kdc: returning referral TGT for ccache",(*tgts)[0]->server);
 #endif
+#if 0
            }
+#endif
        }
     }