Fix various minor format-string issues
authorKen Raeburn <raeburn@mit.edu>
Tue, 3 Jun 2008 00:13:25 +0000 (00:13 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 3 Jun 2008 00:13:25 +0000 (00:13 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20356 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftp/ftp.c
src/kadmin/dbutil/dump.c
src/kadmin/server/kadm_rpc_svc.c
src/kadmin/server/ovsec_kadmd.c
src/kadmin/server/schpw.c
src/kadmin/testing/util/tcl_kadm5.c
src/kadmin/testing/util/tcl_ovsec_kadm.c

index 02fb4baebef6f89e792366a1f0c25c9d5950d290..227ca5efc7eb7d6b038550769b009c9aba8d7628 100644 (file)
@@ -475,9 +475,9 @@ static int secure_command(char* cmd)
                                        "GSSAPI didn't encrypt message");
                        } else {
                                if (debug)
-                                 fprintf(stderr, "sealed (%s) %d bytes\n",
+                                 fprintf(stderr, "sealed (%s) %lu bytes\n",
                                          clevel==PROT_P?"ENC":"MIC", 
-                                         out_buf.length);
+                                         (unsigned long) out_buf.length);
                                length=out_buf.length;
                                memcpy(out, out_buf.value, out_buf.length);
                                gss_release_buffer(&min_stat, &out_buf);
index 5c627d30cf0c2786d8fde2cdadf7b58aa3d84f66..44675a6b2cac6712ab9a4e83a635df3649c2aa3e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * kadmin/dbutil/dump.c
  *
- * Copyright 1990,1991,2001,2006 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2001,2006,2008 by the Massachusetts Institute of Technology.
  * All Rights Reserved.
  *
  * Export of this software from the United States of America may
@@ -597,8 +597,9 @@ dump_k5beta_iterator(ptr, entry)
         * First put out strings representing the length of the variable
         * length data in this record, then the name and the primary key type.
         */
-       fprintf(arg->ofile, "%d\t%d\t%d\t%d\t%d\t%d\t%s\t%d\t", strlen(name),
-               strlen(mod_name),
+       fprintf(arg->ofile, "%lu\t%lu\t%d\t%d\t%d\t%d\t%s\t%d\t",
+               (unsigned long) strlen(name),
+               (unsigned long) strlen(mod_name),
                (krb5_int32) pkey->key_data_length[0],
                (krb5_int32) akey->key_data_length[0],
                (krb5_int32) pkey->key_data_length[1],
@@ -748,9 +749,9 @@ dump_k5beta6_iterator_ext(ptr, entry, kadm)
        
        if (counter + skip == entry->n_tl_data) {
            /* Pound out header */
-           fprintf(arg->ofile, "%d\t%d\t%d\t%d\t%d\t%s\t",
+           fprintf(arg->ofile, "%d\t%lu\t%d\t%d\t%d\t%s\t",
                    (int) entry->len,
-                   strlen(name),
+                   (unsigned long) strlen(name),
                    counter,
                    (int) entry->n_key_data,
                    (int) entry->e_length,
index cd1f0d2f1a0988f32a212dad81d7399283271ae1..733602052a95c460db00a66e4cc91c4ba04b9183 100644 (file)
@@ -301,7 +301,7 @@ check_rpcsec_auth(struct svc_req *rqstp)
 fail_princ:
      if (!success) {
         krb5_klog_syslog(LOG_ERR, "bad service principal %.*s%s",
-                         slen, gss_str.value, sdots);
+                         (int) slen, (char *) gss_str.value, sdots);
      }
      gss_release_buffer(&min_stat, &gss_str);
      krb5_free_principal(kctx, princ);
index e5e4e307fca94437e5f028dec42ff1482bedb653..659ebfba3877d40ed32286266613aae8ef8d5ffe 100644 (file)
@@ -337,7 +337,7 @@ int main(int argc, char *argv[])
 
      if ((params.mask & REQUIRED_PARAMS) != REQUIRED_PARAMS) {
          krb5_klog_syslog(LOG_ERR, "%s: Missing required configuration values "
-                          "while initializing, aborting", whoami,
+                          "(%lx) while initializing, aborting", whoami,
                           (params.mask & REQUIRED_PARAMS) ^ REQUIRED_PARAMS);
          fprintf(stderr, "%s: Missing required configuration values "
                  "(%lx) while initializing, aborting\n", whoami,
@@ -406,7 +406,7 @@ int main(int argc, char *argv[])
         if (setsockopt(schpw, SOL_SOCKET, SO_REUSEADDR,
                        (char *) &allowed, sizeof(allowed)) < 0) {
             const char *e_txt = krb5_get_error_message (context, ret);
-            krb5_klog_syslog(LOG_ERR, "main",
+            krb5_klog_syslog(LOG_ERR,
                              "cannot set SO_REUSEADDR on simple chpw socket: %s", 
                              e_txt);
             fprintf(stderr,
@@ -1029,13 +1029,13 @@ void log_badverf(gss_name_t client_name, gss_name_t server_name,
      if (procname != NULL)
          krb5_klog_syslog(LOG_NOTICE, "WARNING! Forged/garbled request: %s, "
                           "claimed client = %.*s%s, server = %.*s%s, addr = %s",
-                          procname, clen, client.value, cdots,
-                          slen, server.value, sdots, a);
+                          procname, (int) clen, (char *) client.value, cdots,
+                          (int) slen, (char *) server.value, sdots, a);
      else
          krb5_klog_syslog(LOG_NOTICE, "WARNING! Forged/garbled request: %d, "
                           "claimed client = %.*s%s, server = %.*s%s, addr = %s",
-                          proc, clen, client.value, cdots,
-                          slen, server.value, sdots, a);
+                          proc, (int) clen, (char *) client.value, cdots,
+                          (int) slen, (char *) server.value, sdots, a);
 
      (void) gss_release_buffer(&minor, &client);
      (void) gss_release_buffer(&minor, &server);
@@ -1125,12 +1125,14 @@ void log_badauth_display_status_1(char *m, OM_uint32 code, int type,
                    log_badauth_display_status_1(m, minor_stat,
                                                 GSS_C_MECH_CODE, 1);
               } else
-                   krb5_klog_syslog(LOG_ERR, "GSS-API authentication error %s: "
-                          "recursive failure!", msg);
+                   krb5_klog_syslog(LOG_ERR, "GSS-API authentication error %.*s: "
+                                    "recursive failure!", (int) msg.length,
+                                    (char *) msg.value);
               return;
          }
 
-         krb5_klog_syslog(LOG_NOTICE, "%s %s", m, (char *)msg.value); 
+         krb5_klog_syslog(LOG_NOTICE, "%s %.*s", m, (int)msg.length,
+                          (char *)msg.value);
          (void) gss_release_buffer(&minor_stat, &msg);
          
          if (!msg_ctx)
index 3d1d47955b62cd2e9eaa77ca4e2fcfc6d0dadbec..9e1113a5920ce1310807ca449ee9e01a101d524b 100644 (file)
@@ -264,7 +264,7 @@ process_chpw_request(context, server_handle, realm, s, keytab, sockin,
     trunc_name(&clen, &cdots);
     krb5_klog_syslog(LOG_NOTICE, "chpw request from %s for %.*s%s: %s",
                     inet_ntoa(((struct sockaddr_in *)&remote_addr)->sin_addr),
-                    clen, clientstr, cdots,
+                    (int) clen, clientstr, cdots,
                     ret ? krb5_get_error_message (context, ret) : "success");
     krb5_free_unparsed_name(context, clientstr);
 
index 21c6418480829a25c8721d0537dcf5320e76c88d..ebd3037a3035abdd896d22ddc9c7d3ad1af57bb7 100644 (file)
@@ -418,7 +418,7 @@ static Tcl_DString *unparse_err(kadm5_ret_t code)
      case ENOENT: code_string = "ENOENT"; break;
 
      default:
-        fprintf(stderr, "**** CODE %d (%s) ***\n", code,
+        fprintf(stderr, "**** CODE %ld (%s) ***\n", (long) code,
                 error_message (code));
         code_string = "UNKNOWN";
         break;
@@ -956,8 +956,8 @@ static int parse_tl_data(Tcl_Interp *interp, const char *list,
          tl->tl_data_length = tmp;
          if (tl->tl_data_length != strlen(argv1[2])) {
               sprintf(interp->result, "specified length %d does not "
-                      "match length %d of string \"%s\"", tmp,
-                      strlen(argv1[2]), argv1[2]);
+                      "match length %lu of string \"%s\"", tmp,
+                      (unsigned long) strlen(argv1[2]), argv1[2]);
               retcode = TCL_ERROR;
               goto finished;
          }
index cf732fc4ab7bf69d3c53f10b40a14921423a5c04..a64c5603f7a65926dac58c3d480f5db7000c40bf 100644 (file)
@@ -378,7 +378,7 @@ static Tcl_DString *unparse_err(ovsec_kadm_ret_t code)
      case EINVAL: code_string = "EINVAL"; break;
      case ENOENT: code_string = "ENOENT"; break;
      default:
-        fprintf(stderr, "**** CODE %d (%s) ***\n", code,
+        fprintf(stderr, "**** CODE %ld (%s) ***\n", (long) code,
                 error_message (code));
         code_string = "UNKNOWN";
         break;