svn rev #21627: trunk/src/lib/kdb/

epeisach@MIT.EDU epeisach at MIT.EDU
Mon Dec 29 08:37:22 EST 2008


http://src.mit.edu/fisheye/changelog/krb5/?cs=21627
Commit By: epeisach
Log Message:
Create a private header file for local functions missing prototypes.
Fix a number of warnning suggesting parenthesis.
Fix a signed/unsigned warning.
Update dependencies.




Changed Files:
U   trunk/src/lib/kdb/Makefile.in
U   trunk/src/lib/kdb/kdb5.c
A   trunk/src/lib/kdb/kdb5int.h
U   trunk/src/lib/kdb/kdb_log.c
Modified: trunk/src/lib/kdb/Makefile.in
===================================================================
--- trunk/src/lib/kdb/Makefile.in	2008-12-29 13:16:03 UTC (rev 21626)
+++ trunk/src/lib/kdb/Makefile.in	2008-12-29 13:37:20 UTC (rev 21627)
@@ -86,7 +86,7 @@
   $(SRCTOP)/include/kdb_log.h $(SRCTOP)/include/krb5.h \
   $(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/krb5/preauth_plugin.h \
   $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  adb_err.h kdb5.c kdb5.h
+  adb_err.h kdb5.c kdb5.h kdb5int.h
 encrypt_key.so encrypt_key.po $(OUTPRE)encrypt_key.$(OBJEXT): \
   $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
   $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
@@ -172,7 +172,7 @@
   $(SRCTOP)/include/kdb_log.h $(SRCTOP)/include/krb5.h \
   $(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/krb5/preauth_plugin.h \
   $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  kdb5.h kdb_log.c
+  kdb5.h kdb5int.h kdb_log.c
 keytab.so keytab.po $(OUTPRE)keytab.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
   $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
   $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(SRCTOP)/include/k5-buf.h \

Modified: trunk/src/lib/kdb/kdb5.c
===================================================================
--- trunk/src/lib/kdb/kdb5.c	2008-12-29 13:16:03 UTC (rev 21626)
+++ trunk/src/lib/kdb/kdb5.c	2008-12-29 13:37:20 UTC (rev 21627)
@@ -38,6 +38,7 @@
 #include "kdb5.h"
 #include <assert.h>
 #include "kdb_log.h"
+#include "kdb5int.h"
 
 /* Currently DB2 policy related errors are exported from DAL.  But
    other databases should set_err function to return string.  */
@@ -1109,7 +1110,7 @@
 		upd->kdb_princ_name.utf8str_t_val = princ_name;
 		upd->kdb_princ_name.utf8str_t_len = strlen(princ_name);
 
-                if (status = ulog_add_update(kcontext, upd))
+                if ((status = ulog_add_update(kcontext, upd)))
 			goto err_lock;
 		upd++;
         }

Added: trunk/src/lib/kdb/kdb5int.h
===================================================================
--- trunk/src/lib/kdb/kdb5int.h	2008-12-29 13:16:03 UTC (rev 21626)
+++ trunk/src/lib/kdb/kdb5int.h	2008-12-29 13:37:20 UTC (rev 21627)
@@ -0,0 +1,44 @@
+/*
+ * lib/kdb5/kdb5int.h
+ *
+ * Copyright (C) 2008 by the Massachusetts Institute of Technology.
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may
+ *   require a specific license from the United States Government.
+ *   It is the responsibility of any person or organization contemplating
+ *   export to obtain such a license before exporting.
+ * 
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission.  Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose.  It is provided "as is" without express
+ * or implied warranty.
+ * 
+ *
+ * Private header file for the kdb5 library for internal functions
+ */
+
+#ifndef __KDB5INT_H__
+#define __KDB5INT_H__
+
+#include "kdb5.h"
+
+krb5_error_code
+krb5int_put_principal_no_log(krb5_context kcontext,
+			     krb5_db_entry *entries, int *nentries);
+
+krb5_error_code
+krb5int_delete_principal_no_log(krb5_context kcontext,
+				krb5_principal search_for,
+				int *nentries);
+
+#endif /* __KDB5INT_H__ */

Modified: trunk/src/lib/kdb/kdb_log.c
===================================================================
--- trunk/src/lib/kdb/kdb_log.c	2008-12-29 13:16:03 UTC (rev 21626)
+++ trunk/src/lib/kdb/kdb_log.c	2008-12-29 13:37:20 UTC (rev 21627)
@@ -16,6 +16,7 @@
 #include <syslog.h>
 #include "kdb5.h"
 #include "kdb_log.h"
+#include "kdb5int.h"
 
 /*
  * This modules includes all the necessary functions that create and
@@ -73,7 +74,7 @@
 	   (pagesize-1)) & (~(pagesize-1));
 
     size = end - start;
-    if (retval = msync((caddr_t)start, size, MS_SYNC)) {
+    if ((retval = msync((caddr_t)start, size, MS_SYNC))) {
 	return (retval);
     }
 
@@ -186,10 +187,10 @@
     recsize = sizeof (kdb_ent_header_t) + upd_size;
 
     if (recsize > ulog->kdb_block) {
-	if (retval = ulog_resize(ulog, ulogentries, ulogfd, recsize)) {
-	    /* Resize element array failed */
-	    return (retval);
-	}
+	    if ((retval = ulog_resize(ulog, ulogentries, ulogfd, recsize))) {
+		    /* Resize element array failed */
+		    return (retval);
+	    }
     }
 
     cur_sno = ulog->kdb_last_sno;
@@ -227,7 +228,7 @@
     if (!xdr_kdb_incr_update_t(&xdrs, upd))
 	return (KRB5_LOG_CONV);
 
-    if (retval = ulog_sync_update(ulog, indx_log))
+    if ((retval = ulog_sync_update(ulog, indx_log)))
 	return (retval);
 
     if (ulog->kdb_num < ulogentries)
@@ -280,7 +281,7 @@
 
     ulog->kdb_state = KDB_STABLE;
 
-    if (retval = ulog_sync_update(ulog, indx_log))
+    if ((retval = ulog_sync_update(ulog, indx_log)))
 	return (retval);
 
     ulog_sync_header(ulog);
@@ -370,8 +371,8 @@
 			   (upd->kdb_princ_name.utf8str_t_len + 1));
 	    dbprincstr[upd->kdb_princ_name.utf8str_t_len] = 0;
 
-	    if (retval = krb5_parse_name(context, dbprincstr,
-					 &dbprinc)) {
+	    if ((retval = krb5_parse_name(context, dbprincstr,
+					  &dbprinc))) {
 		goto cleanup;
 	    }
 
@@ -398,7 +399,7 @@
 
 	    (void) memset(entry, 0, sizeof (krb5_db_entry));
 
-	    if (retval = ulog_conv_2dbentry(context, entry, upd, 1))
+	    if ((retval = ulog_conv_2dbentry(context, entry, upd, 1)))
 		goto cleanup;
 
 	    retval = krb5int_put_principal_no_log(context, entry,
@@ -441,7 +442,7 @@
 {
     XDR			xdrs;
     krb5_error_code	retval = 0;
-    int			i;
+    unsigned int	i;
     kdb_ent_header_t	*indx_log;
     kdb_incr_update_t	*upd = NULL;
     kdb_incr_result_t	*incr_ret = NULL;




More information about the cvs-krb5 mailing list