svn commit: lorikeet r321 - in trunk/heimdal/lib: hdb krb5

abartlet at samba.org abartlet at samba.org
Thu Jun 2 09:22:28 GMT 2005


Author: abartlet
Date: 2005-06-02 09:22:27 +0000 (Thu, 02 Jun 2005)
New Revision: 321

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=321

Log:
Add more const.  I'm not sure of the technical implications of adding
const to the lib/krb5 stuff however...
(Given it is in theory a public library interface)

Andrew Bartlett

Modified:
   trunk/heimdal/lib/hdb/hdb-ldb.c
   trunk/heimdal/lib/krb5/krb5-protos.h
   trunk/heimdal/lib/krb5/principal.c


Changeset:
Modified: trunk/heimdal/lib/hdb/hdb-ldb.c
===================================================================
--- trunk/heimdal/lib/hdb/hdb-ldb.c	2005-06-02 08:14:29 UTC (rev 320)
+++ trunk/heimdal/lib/hdb/hdb-ldb.c	2005-06-02 09:22:27 UTC (rev 321)
@@ -217,7 +217,7 @@
  * Construct an hdb_entry from a directory entry.
  */
 static krb5_error_code LDB_message2entry(krb5_context context, HDB *db, 
-					 TALLOC_CTX *mem_ctx, krb5_principal principal,
+					 TALLOC_CTX *mem_ctx, krb5_const_principal principal,
 					 enum hdb_ent_type ent_type, struct ldb_message *realm_msg,
 					 struct ldb_message *msg,
 					 hdb_entry *ent)
@@ -453,7 +453,7 @@
 
 static krb5_error_code LDB_lookup_principal(krb5_context context, struct ldb_context *ldb_ctx, 					
 					    TALLOC_CTX *mem_ctx,
-					    krb5_principal principal,
+					    krb5_const_principal principal,
 					    enum hdb_ent_type ent_type,
 					    const char *realm_dn,
 					    struct ldb_message ***pmsg)
@@ -733,7 +733,7 @@
 }
 
 static krb5_error_code LDB_fetch(krb5_context context, HDB *db, unsigned flags,
-				 krb5_principal principal,
+				 krb5_const_principal principal,
 				 enum hdb_ent_type ent_type,
 				 hdb_entry *entry)
 {
@@ -762,13 +762,14 @@
 
 	realm_dn = realm_msg[0]->dn;
 
-	/* Cludge, cludge cludge.  If the realm part of krbtgt/realm
+	/* Cludge, cludge cludge.  If the realm part of krbtgt/realm,
 	 * is in our db, then direct the caller at our primary
 	 * krgtgt */
-	if(principal->name.name_string.len == 2
-	   && (strcmp(principal->name.name_string.val[0], KRB5_TGS_NAME) == 0)
-		&& (LDB_lookup_realm(context, (struct ldb_context *)db->hdb_db,
-				     mem_ctx, principal->name.name_string.val[1], NULL) == 0)) {
+	if (ent_type != HDB_ENT_TYPE_KRBTGT 
+	    && principal->name.name_string.len == 2
+	    && (strcmp(principal->name.name_string.val[0], KRB5_TGS_NAME) == 0)
+	    && (LDB_lookup_realm(context, (struct ldb_context *)db->hdb_db,
+				 mem_ctx, principal->name.name_string.val[1], NULL) == 0)) {
 		ent_type = HDB_ENT_TYPE_KRBTGT;
 	}
 

Modified: trunk/heimdal/lib/krb5/krb5-protos.h
===================================================================
--- trunk/heimdal/lib/krb5/krb5-protos.h	2005-06-02 08:14:29 UTC (rev 320)
+++ trunk/heimdal/lib/krb5/krb5-protos.h	2005-06-02 09:22:27 UTC (rev 321)
@@ -20,6 +20,15 @@
 #endif
 #endif
 
+void
+initialize_heim_error_table_r (struct et_list **/*list*/);
+
+void
+initialize_k524_error_table_r (struct et_list **/*list*/);
+
+void
+initialize_krb5_error_table_r (struct et_list **/*list*/);
+
 krb5_error_code KRB5_LIB_FUNCTION
 krb524_convert_creds_kdc (
 	krb5_context /*context*/,
@@ -2413,7 +2422,7 @@
 const char* KRB5_LIB_FUNCTION
 krb5_principal_get_realm (
 	krb5_context /*context*/,
-	krb5_principal /*principal*/);
+	krb5_const_principal /*principal*/);
 
 int KRB5_LIB_FUNCTION
 krb5_principal_get_type (

Modified: trunk/heimdal/lib/krb5/principal.c
===================================================================
--- trunk/heimdal/lib/krb5/principal.c	2005-06-02 08:14:29 UTC (rev 320)
+++ trunk/heimdal/lib/krb5/principal.c	2005-06-02 09:22:27 UTC (rev 321)
@@ -76,7 +76,7 @@
 
 const char* KRB5_LIB_FUNCTION
 krb5_principal_get_realm(krb5_context context,
-			 krb5_principal principal)
+			 krb5_const_principal principal)
 {
     return princ_realm(principal);
 }			 



More information about the samba-cvs mailing list