Add gssrpcint.h to contain prototype for gssrpcint_printf. Include
authorEzra Peisach <epeisach@mit.edu>
Mon, 29 Dec 2008 17:39:29 +0000 (17:39 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 29 Dec 2008 17:39:29 +0000 (17:39 +0000)
gcc printf attribute if supported. Include header file and fix up some
of the debugging printf arguments.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21632 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/rpc/Makefile.in
src/lib/rpc/auth_gssapi.c
src/lib/rpc/auth_gssapi_misc.c
src/lib/rpc/gssrpcint.h [new file with mode: 0644]
src/lib/rpc/svc_auth_gssapi.c

index e4a8eac6f4a3ef15c8111adcc3581064826609e5..29a9926b4aafdf37feb0c18cda951f548818dd6d 100644 (file)
@@ -282,7 +282,7 @@ auth_gssapi.so auth_gssapi.po $(OUTPRE)auth_gssapi.$(OBJEXT): \
   $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
   $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
   $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
-  $(SRCTOP)/include/krb5.h auth_gssapi.c
+  $(SRCTOP)/include/krb5.h auth_gssapi.c gssrpcint.h
 auth_gssapi_misc.so auth_gssapi_misc.po $(OUTPRE)auth_gssapi_misc.$(OBJEXT): \
   $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
   $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
@@ -290,7 +290,7 @@ auth_gssapi_misc.so auth_gssapi_misc.po $(OUTPRE)auth_gssapi_misc.$(OBJEXT): \
   $(SRCTOP)/include/gssrpc/clnt.h $(SRCTOP)/include/gssrpc/rename.h \
   $(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
   $(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
-  $(SRCTOP)/include/gssrpc/xdr.h auth_gssapi_misc.c
+  $(SRCTOP)/include/gssrpc/xdr.h auth_gssapi_misc.c gssrpcint.h
 bindresvport.so bindresvport.po $(OUTPRE)bindresvport.$(OBJEXT): \
   $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
   $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
@@ -495,7 +495,7 @@ svc_auth_gssapi.so svc_auth_gssapi.po $(OUTPRE)svc_auth_gssapi.$(OBJEXT): \
   $(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
   $(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
   $(SRCTOP)/include/gssrpc/xdr.h $(SRCTOP)/include/krb5.h \
-  svc_auth_gssapi.c
+  gssrpcint.h svc_auth_gssapi.c
 svc_raw.so svc_raw.po $(OUTPRE)svc_raw.$(OBJEXT): $(BUILDTOP)/include/gssapi/gssapi.h \
   $(BUILDTOP)/include/gssrpc/types.h $(SRCTOP)/include/gssrpc/auth.h \
   $(SRCTOP)/include/gssrpc/auth_gss.h $(SRCTOP)/include/gssrpc/auth_unix.h \
index fa8ce4b1764cfa5cf7bbdca97d5d6db614daac97..7211156708614d649e1bd657c620aed5a70c8d47 100644 (file)
@@ -16,6 +16,8 @@
 #include <gssrpc/rpc.h>
 #include <gssrpc/auth_gssapi.h>
 
+#include "gssrpcint.h"
+
 #ifdef __CODECENTER__
 #define DEBUG_GSSAPI 1
 #endif
index 89569f0a62ba18687026c9520d449687c89a767b..908ac0cb2a8261656733619c388a304b169d6863 100644 (file)
@@ -9,6 +9,8 @@
 #include <gssapi/gssapi.h>
 #include <gssrpc/auth_gssapi.h>
 
+#include "gssrpcint.h"
+
 #ifdef __CODECENTER__
 #define DEBUG_GSSAPI 1
 #endif
@@ -181,7 +183,7 @@ static void auth_gssapi_display_status_1(
          putc ('\n', stderr);
          if (misc_debug_gssapi)
              gssrpcint_printf("GSS-API authentication error %s: %*s\n",
-                              m, msg.length, msg.value);
+                              m, msg.length, (char *) msg.value);
          (void) gss_release_buffer(&minor_stat, &msg);
          
          if (!msg_ctx)
diff --git a/src/lib/rpc/gssrpcint.h b/src/lib/rpc/gssrpcint.h
new file mode 100644 (file)
index 0000000..c9f03d8
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * lib/rpc/gssrpcint.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.
+ * 
+ *
+ * <<< Description >>>
+ */
+
+#ifndef __GSSRPCINT_H__
+#define __GSSRPCINT_H__
+
+extern void gssrpcint_printf(const char *format, ...)
+#if !defined(__cplusplus) && (__GNUC__ > 2)
+    __attribute__((__format__(__printf__, 1, 2)))
+#endif
+  ;
+
+#endif /* __GSSRPCINT_H__ */
index f899c896896a1fa31f5c7d9b8506e10c56b241b0..e374f006badb628dde021a3f32a8c36d7140cebf 100644 (file)
@@ -24,6 +24,8 @@
 #include <gssapi/gssapi_krb5.h>
 #endif
 
+#include "gssrpcint.h"
+
 #ifdef GSSAPI_KRB5
 /* This is here for the krb5_error_code typedef and the
    KRB5KRB_AP_WRONG_PRINC #define.*/
@@ -403,7 +405,7 @@ enum auth_stat gssrpc__svcauth_gssapi(
                    break;
 
               PRINTF(("accept_sec_context returned 0x%x 0x%x wrong-princ=%#x\n",
-                      call_res.gss_major, call_res.gss_minor, KRB5KRB_AP_WRONG_PRINC));
+                      call_res.gss_major, call_res.gss_minor, (int) KRB5KRB_AP_WRONG_PRINC));
               if (call_res.gss_major == GSS_S_COMPLETE ||
                   call_res.gss_major == GSS_S_CONTINUE_NEEDED) {
                    /* server_creds was right, set it! */
@@ -950,7 +952,7 @@ bool_t svcauth_gssapi_set_names(
          in_buf.value = names[i].name;
          in_buf.length = strlen(in_buf.value) + 1;
 
-         PRINTF(("svcauth_gssapi_set_names: importing %s\n", in_buf.value));
+         PRINTF(("svcauth_gssapi_set_names: importing %s\n", names[i].name));
 
          gssstat = gss_import_name(&minor_stat, &in_buf, names[i].type,
                                    &server_name_list[i]);