From 2bc5e0dc09a5bb9bc082a2743cc74cc327c07c01 Mon Sep 17 00:00:00 2001
From: Zhanna Tsitkov <tsitkova@mit.edu>
Date: Tue, 5 Jan 2010 21:11:03 +0000
Subject: [PATCH 107/120] Rename krb5int_tgtname into krb5_tgtname as an
 internal function

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23590 dc483132-0cff-0310-8789-dd5450dbe970
---
 src/lib/krb5/krb/fast.c       | 2 +-
 src/lib/krb5/krb/gc_frm_kdc.c | 8 ++++----
 src/lib/krb5/krb/int-proto.h  | 2 +-
 src/lib/krb5/krb/s4u_creds.c  | 2 +-
 src/lib/krb5/krb/tgtname.c    | 6 ++----
 src/lib/krb5/krb/walk_rtree.c | 8 ++++----
 src/lib/krb5/libkrb5.exports  | 2 +-
 7 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/lib/krb5/krb/fast.c b/src/lib/krb5/krb/fast.c
index e991261..201a299 100644
--- a/src/lib/krb5/krb/fast.c
+++ b/src/lib/krb5/krb/fast.c
@@ -148,7 +148,7 @@ krb5int_fast_as_armor(krb5_context context,
         retval = krb5_cc_resolve(context, opte->opt_private->fast_ccache_name,
                                  &ccache);
         if (retval == 0) {
-            retval = krb5_tgtname(context, target_realm, target_realm,
+            retval = krb5int_tgtname(context, target_realm, target_realm,
                                   &target_principal);
         }
         if (retval == 0) {
diff --git a/src/lib/krb5/krb/gc_frm_kdc.c b/src/lib/krb5/krb/gc_frm_kdc.c
index 581d89d..30e1c40 100644
--- a/src/lib/krb5/krb/gc_frm_kdc.c
+++ b/src/lib/krb5/krb/gc_frm_kdc.c
@@ -293,7 +293,7 @@ tr_dbg_rtree(struct tr_state *ts, const char *prog, krb5_principal princ)
  * krbtgt/realm_of(DST)@realm_of(SRC) as the server principal.  Zeroes
  * MCREDS first, does not allocate MCREDS, and cleans MCREDS on
  * failure.  The peculiar ordering of DST and SRC args is for
- * consistency with krb5_tgtname().
+ * consistency with krb5int_tgtname().
  */
 static krb5_error_code
 tgt_mcred(krb5_context ctx, krb5_principal client,
@@ -309,7 +309,7 @@ tgt_mcred(krb5_context ctx, krb5_principal client,
     if (retval)
         goto cleanup;
 
-    retval = krb5_tgtname(ctx, krb5_princ_realm(ctx, dst),
+    retval = krb5int_tgtname(ctx, krb5_princ_realm(ctx, dst),
                           krb5_princ_realm(ctx, src), &mcreds->server);
     if (retval)
         goto cleanup;
@@ -547,7 +547,7 @@ kdc_mcred(struct tr_state *ts, krb5_principal client, krb5_creds *mcreds)
     if (retval)
         goto cleanup;
 
-    retval = krb5_tgtname(ts->ctx, rdst, rsrc, &mcreds->server);
+    retval = krb5int_tgtname(ts->ctx, rdst, rsrc, &mcreds->server);
     if (retval)
         goto cleanup;
 
@@ -801,7 +801,7 @@ chase_offpath(struct tr_state *ts,
         nxt_tgt = NULL;
         memset(&mcred, 0, sizeof(mcred));
         rsrc = krb5_princ_component(ts->ctx, cur_tgt->server, 1);
-        retval = krb5_tgtname(ts->ctx, rdst, rsrc, &mcred.server);
+        retval = krb5int_tgtname(ts->ctx, rdst, rsrc, &mcred.server);
         if (retval)
             goto cleanup;
         mcred.client = client;
diff --git a/src/lib/krb5/krb/int-proto.h b/src/lib/krb5/krb/int-proto.h
index b64bc4f..ac30a52 100644
--- a/src/lib/krb5/krb/int-proto.h
+++ b/src/lib/krb5/krb/int-proto.h
@@ -33,7 +33,7 @@
 #define KRB5_INT_FUNC_PROTO__
 
 krb5_error_code
-krb5_tgtname(krb5_context context, const krb5_data *, const krb5_data *,
+krb5int_tgtname(krb5_context context, const krb5_data *, const krb5_data *,
              krb5_principal *);
 
 krb5_error_code
diff --git a/src/lib/krb5/krb/s4u_creds.c b/src/lib/krb5/krb/s4u_creds.c
index c0c9fe2..d7d4c6b 100644
--- a/src/lib/krb5/krb/s4u_creds.c
+++ b/src/lib/krb5/krb/s4u_creds.c
@@ -506,7 +506,7 @@ krb5_get_self_cred_from_kdc(krb5_context context,
     s4u_user.user_id.options = KRB5_S4U_OPTS_USE_REPLY_KEY_USAGE;
 
     /* First, acquire a TGT to the user's realm. */
-    code = krb5_tgtname(context, user_realm,
+    code = krb5int_tgtname(context, user_realm,
                         krb5_princ_realm(context, in_creds->server), &tgs);
     if (code != 0)
         goto cleanup;
diff --git a/src/lib/krb5/krb/tgtname.c b/src/lib/krb5/krb/tgtname.c
index cfd01cb..416badd 100644
--- a/src/lib/krb5/krb/tgtname.c
+++ b/src/lib/krb5/krb/tgtname.c
@@ -25,16 +25,14 @@
  * or implied warranty.
  *
  *
- * krb5_tgtname()
+ * krb5int_tgtname()
  */
 
 #include "k5-int.h"
 #include "int-proto.h"
 
-/* This is an internal-only function, used by krb5_get_cred_from_kdc() */
-
 krb5_error_code
-krb5_tgtname(krb5_context context, const krb5_data *server, const krb5_data *client, krb5_principal *tgtprinc)
+krb5int_tgtname(krb5_context context, const krb5_data *server, const krb5_data *client, krb5_principal *tgtprinc)
 {
     return krb5_build_principal_ext(context, tgtprinc, client->length, client->data,
                                     KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME,
diff --git a/src/lib/krb5/krb/walk_rtree.c b/src/lib/krb5/krb/walk_rtree.c
index 3c5a945..8e19e68 100644
--- a/src/lib/krb5/krb/walk_rtree.c
+++ b/src/lib/krb5/krb/walk_rtree.c
@@ -213,17 +213,17 @@ rtree_capath_tree(krb5_context context,
     /* Invariant: PPRINC points one past end of list. */
     pprinc = &tree[0];
     /* Local TGS name */
-    retval = krb5_tgtname(context, client, client, pprinc++);
+    retval = krb5int_tgtname(context, client, client, pprinc++);
     if (retval) goto error;
     srcrealm = *client;
     for (i = 0; i < nlinks; i++) {
         dstrealm.data = vals[i];
         dstrealm.length = strcspn(vals[i], "\t ");
-        retval = krb5_tgtname(context, &dstrealm, &srcrealm, pprinc++);
+        retval = krb5int_tgtname(context, &dstrealm, &srcrealm, pprinc++);
         if (retval) goto error;
         srcrealm = dstrealm;
     }
-    retval = krb5_tgtname(context, server, &srcrealm, pprinc++);
+    retval = krb5int_tgtname(context, server, &srcrealm, pprinc++);
     if (retval) goto error;
     *rettree = tree;
 
@@ -326,7 +326,7 @@ rtree_hier_tree(krb5_context context,
     srcrealm = client;
     for (i = 0; i < nrealms; i++) {
         dstrealm = &realms[i];
-        retval = krb5_tgtname(context, dstrealm, srcrealm, pprinc++);
+        retval = krb5int_tgtname(context, dstrealm, srcrealm, pprinc++);
         if (retval) goto error;
         srcrealm = dstrealm;
     }
diff --git a/src/lib/krb5/libkrb5.exports b/src/lib/krb5/libkrb5.exports
index 8d1d9d3..c3af209 100644
--- a/src/lib/krb5/libkrb5.exports
+++ b/src/lib/krb5/libkrb5.exports
@@ -549,7 +549,7 @@ krb5_string_to_deltat
 krb5_string_to_salttype
 krb5_string_to_timestamp
 krb5_sync_disk_file
-krb5_tgtname
+krb5int_tgtname
 krb5_timeofday
 krb5_timestamp_to_sfstring
 krb5_timestamp_to_string
-- 
2.6.6

