Cleaned up TGTNAME define; now KRB5_TGS_NAME
authorTheodore Tso <tytso@mit.edu>
Tue, 17 Aug 1993 03:58:24 +0000 (03:58 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 17 Aug 1993 03:58:24 +0000 (03:58 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2632 dc483132-0cff-0310-8789-dd5450dbe970

src/admin/convert/kdb5_convert.c
src/admin/create/kdb5_create.c
src/appl/bsd/forward.c
src/appl/telnet/libtelnet/forward.c
src/clients/kinit/kinit.c
src/include/krb5/base-defs.h
src/include/krb5/kdb.h
src/kadmin/server/adm_extern.c
src/kadmin/server/adm_server.c
src/lib/krb5/krb/tgtname.c
src/tests/hammer/kdc5_hammer.c

index 3d5fb094b60ede793178cf2bc723eb28b0197477..fa82da1de60dcca356d6abd04c9833709977d1db 100644 (file)
@@ -124,7 +124,7 @@ krb5_principal master_princ;
 krb5_encrypt_block master_encblock;
 
 krb5_data tgt_princ_entries[] = {
-       {sizeof(TGTNAME)-1, TGTNAME},
+       {KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME},
        {0, 0} };
 
 krb5_data db_creator_entries[] = {
index e7128882d1e10721147c0175b1f60b8933f6af42..5a08533de569441feafc7330331f92fb82df4268 100644 (file)
@@ -97,7 +97,7 @@ krb5_principal master_princ;
 krb5_encrypt_block master_encblock;
 
 krb5_data tgt_princ_entries[] = {
-       {sizeof(TGTNAME)-1, TGTNAME},
+       {KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME},
        {0, 0} };
 
 krb5_data db_creator_entries[] = {
index 1e49129970e525f1ff3043179aa558b57f4aabb6..cdeb878736af5170e83a96f92bc926e73d5cd697 100644 (file)
@@ -41,7 +41,6 @@ static char *rcsid_forward_c =
 #include <krb5/los-proto.h>
 #include <krb5/ext-proto.h>
 
-#define TGTNAME "krbtgt"            /* Else #include <krb5/kdb.h> */
 #define KRB5_DEFAULT_LIFE 60*60*8   /* 8 hours */
 /* helper function: convert flags to necessary KDC options */
 #define flags2options(flags) (flags & KDC_TKT_COMMON_MASK)
@@ -126,8 +125,8 @@ get_for_creds(etype, sumtype, rhost, client, enc_key, forwardable, outbuf)
     if (retval = krb5_build_principal_ext(&creds.server,
                                          strlen(hrealms[0]),
                                          hrealms[0],
-                                         sizeof(TGTNAME) - 1,
-                                         TGTNAME,
+                                         KRB5_TGS_NAME_SIZE,
+                                         KRB5_TGS_NAME,
                                          client->realm.length,
                                          client->realm.data,
                                          0))
index 6232ed09ef8f1c8bd2c2461f2a3a2dffeeb3710a..dcc892774470c77698c729cd5ffd51e218fa4ddf 100644 (file)
@@ -41,7 +41,6 @@ static char *rcsid_forward_c =
 #include <krb5/los-proto.h>
 #include <krb5/ext-proto.h>
 
-#define TGTNAME "krbtgt"            /* Else #include <krb5/kdb.h> */
 #define KRB5_DEFAULT_LIFE 60*60*8   /* 8 hours */
 /* helper function: convert flags to necessary KDC options */
 #define flags2options(flags) (flags & KDC_TKT_COMMON_MASK)
@@ -123,8 +122,8 @@ get_for_creds(etype, sumtype, rhost, client, enc_key, forwardable, outbuf)
     if (retval = krb5_build_principal_ext(&creds.server,
                                          strlen(hrealms[0]),
                                          hrealms[0],
-                                         sizeof(TGTNAME) - 1,
-                                         TGTNAME,
+                                         KRB5_TGS_NAME_SIZE,
+                                         KRB5_TGS_NAME,
                                          client->realm.length,
                                          client->realm.data,
                                          0))
index a170e6399d0108faf3f8f1af140bf4b8a8bd646e..7e1c872876d05d784ddfd9c0064958b67f5a9acf 100644 (file)
@@ -35,7 +35,6 @@ static char rcsid_kinit_c [] =
 #include <pwd.h>
 
 #include <krb5/krb5.h>
-#include <krb5/kdb.h>                  /* for TGTNAME */
 #include <krb5/ext-proto.h>
 #include <krb5/los-proto.h>
 
@@ -57,8 +56,8 @@ krb5_parse_lifetime (time, len)
 }
     
 krb5_data tgtname = {
-    sizeof(TGTNAME)-1,
-    TGTNAME
+    KRB5_TGT_NAME_SIZE,
+    KRB5_TGT_NAME
 };
 
 /*
index 4c6eccae2e464cf47ccdcd5676f911860828aae4..433fddecba51bb1b9053dcff25ca1b8909bff853 100644 (file)
@@ -106,12 +106,12 @@ typedef char const * krb5_const_pointer;
 
 typedef struct krb5_principal_data {
     krb5_data realm;
-    krb5_data *data;
+    krb5_data *data;           /* An array of strings */
     krb5_int32 length;
     krb5_int32 type;
 } krb5_principal_data;
 
-typedef        krb5_principal_data *krb5_principal;    /* array of strings */
+typedef        krb5_principal_data *krb5_principal;
 
 /*
  * Per V5 spec on definition of principal types
@@ -142,4 +142,8 @@ typedef const krb5_principal_data *krb5_const_principal;
 #define        krb5_princ_name(princ) (princ)->data
 #define        krb5_princ_component(princ,i) ((princ)->data + i)
 
+/* The name of the Kerberos ticket granting service... and its size */
+#define        KRB5_TGS_NAME           "krbtgt"
+#define KRB5_TGS_NAME_SIZE     6
+
 #endif /* KRB5_BASE_DEFS__ */
index 3c486a22402b1e1fe203a7bd180f49eff9828114..23df43f762fc8311b53bd24d6f747a41bf13c65e 100644 (file)
@@ -188,8 +188,5 @@ krb5_error_code     krb5_db_fetch_mkey
 
 #define KRB5_KDB_DEF_FLAGS     0
 
-/* XXX THIS REALLY BELONGS ELSEWHERE */
-#define        TGTNAME "krbtgt"
-
 #endif /* KRB5_KDB5__ */
 
index 1cdded0a9fc1f6394db38828da0eb07ff3fa5c73..d89875abf572bba8d04848d59038e31b8b1d0822 100644 (file)
@@ -59,7 +59,7 @@ int send_seqno;
 int recv_seqno;
 
 /*
-static krb5_data tgs_name = {sizeof(TGTNAME)-1, TGTNAME};
+static krb5_data tgs_name = {KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME};
 krb5_data *tgs_server[4] = {0, &tgs_name, 0, 0};
 */
 
index c61a8dad445678b345912f4fd22041de6acbf8fa..4d6a0e8777c1ae5962fc56523770c938a5e1d1e9 100644 (file)
@@ -281,7 +281,7 @@ krb5_keyblock *masterkeyblock;
        the master key name here is from the master_princ global,
        so we can safely share its substructure
  */
-    strcpy(tgs_name, TGTNAME);
+    strcpy(tgs_name, KRB5_TGS_NAME);
     strcat(tgs_name, "/");
     strcat(tgs_name, masterkeyname->realm.data);
     krb5_parse_name(tgs_name, &tgs_server);
index 8b6b4261cbdf8740d310202445a246141c7c3f6f..7748bfb09ea9e17c8abda32d99d377461213115d 100644 (file)
@@ -32,7 +32,6 @@ static char rcsid_tgtname_c [] =
 
 #include <krb5/krb5.h>
 #include <krb5/ext-proto.h>
-#include <krb5/kdb.h>
 
 /* This is an internal-only function, used by krb5_get_cred_from_kdc() */
 
@@ -42,7 +41,7 @@ const krb5_data *client, *server;
 krb5_principal *tgtprinc;
 {
     return krb5_build_principal_ext(tgtprinc, server->length, server->data,
-                                   sizeof(TGTNAME) - 1, TGTNAME, 
+                                   KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME, 
                                    client->length, client->data,
                                    0);
 }
index bb7f600477820e6ee8b59ee17d6d18821fc7aa30..9bb93479e683d3296156cd126aa99cf8dd3f3024 100644 (file)
@@ -35,7 +35,6 @@ static char rcsid_hammer_c [] =
 #include <krb5/copyright.h>
 #include <krb5/osconf.h>
 #include <krb5/krb5.h>
-#include <krb5/kdb.h>                  /* for TGTNAME */
 #include <krb5/ext-proto.h>
 #include <krb5/los-proto.h>
 
@@ -61,8 +60,8 @@ krb5_parse_lifetime (time, len)
 }
     
 krb5_data tgtname = {
-    sizeof(TGTNAME)-1,
-    TGTNAME
+    KRB5_TGS_NAME_SIZE,
+    KRB5_TGS_NAME
 };
 
 int verify_cs_pair PROTOTYPE((char *,